[appengine-java] Re: Select query using LIKE
Hi Ravi, If you just want to execute like query for reporting purpose, you may want to look at Yaac project : http://code.google.com/p/yaac/ Sandbox is available for anyone to play with: http://sandbox.yetanotheradminconsole.appspot.com/#query: You can then execute some query like : *select count(*) from job where state like '%READY%'* * * Again, this project is only designed for admins to perform some ad hoc query for reporting purpose. Query executed are not scalable -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/h5oiJxG6WZ0J. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] Re: Select query using LIKE
startsWith() translates to a GREATER_THAN_OR_EQUAL query underneath the hood. BigTable allows for range scans, so this ends up being translated to an index scan for all properties with a value = the target. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Mon, Oct 4, 2010 at 2:58 PM, effpe fredpalle...@gmail.com wrote: This test worked for me Query query = pm.newQuery(Employee.class); query.setFilter(lastName.startsWith(lastNameParam)); query.setOrdering(lastName, firstName, hireDate desc); query.declareParameters(String lastNameParam); ListEmployee results = (ListEmployee) query.execute(lastname); if (results.size()0) { for (Employee e : results) { //e } the .startsWith(...) was in effect the same as .matches(...) because I was NOT allowed to have wildchars as a prefix anyway -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Select query using LIKE
This test worked for me Query query = pm.newQuery(Employee.class); query.setFilter(lastName.startsWith(lastNameParam)); query.setOrdering(lastName, firstName, hireDate desc); query.declareParameters(String lastNameParam); ListEmployee results = (ListEmployee) query.execute(lastname); if (results.size()0) { for (Employee e : results) { //e } the .startsWith(...) was in effect the same as .matches(...) because I was NOT allowed to have wildchars as a prefix anyway -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.