The key difference being that query only requires the query predicate, not the entire query as is required for the find() method. Probably not necessary since the query is against a given region. I've never tried this but seems a bit more tightly coupled for say doing this from a function. I've always used the QueryService. There is a version that allows you to pass in the RegionFunctionContext so you limit what you query on to just the local data.
On Wed, Jan 13, 2016 at 11:34 AM, John Blum <[email protected]> wrote: > Yes, but GemfireTemplate also has this > <https://github.com/spring-projects/spring-data-gemfire/blob/master/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java#L293-L378> > [0]. > > [0] - > https://github.com/spring-projects/spring-data-gemfire/blob/master/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java#L293-L378 > > > > On Wed, Jan 13, 2016 at 10:30 AM, Real Wes Williams < > [email protected]> wrote: > >> >> When I’m in a function that was executed onRegion, is it safe to execute >> the query on the local region? Or use QueryService? >> >> The doc on Region.query omits mention when it says: >> >> * When executed from a client, this method always runs on the server. >> * However application should use QueryService to execute queries. >> * ... >> */ >> public <E> SelectResults<E> query(String queryPredicate) >> throws FunctionDomainException, TypeMismatchException, >> NameResolutionException, >> QueryInvocationTargetException; >> >> But the Spring GemFireTemplate has: >> >> @Override >> public <E> SelectResults<E> query(final String query) { >> try { >> return this.getRegion().query(query); >> >> >> Thanks, >> Wes >> >> > > > -- > -John > 503-504-8657 > john.blum10101 (skype) > -- *Mark Secrist | Sr Manager, **Global Education Delivery* [email protected] 970.214.4567 Mobile *pivotal.io <http://www.pivotal.io/>* Follow Us: Twitter <http://www.twitter.com/pivotal> | LinkedIn <http://www.linkedin.com/company/pivotalsoftware> | Facebook <http://www.facebook.com/pivotalsoftware> | YouTube <http://www.youtube.com/gopivotal> | Google+ <https://plus.google.com/105320112436428794490>
