App Engine's DataNucleus plugin doesn't support the setCandidates method for querying a select group of entities -- all queries currently target the full datastore. You're welcome to file a feature request in the datanucleus-appengine issue tracker, but this isn't likely to be prioritized in the very near future. I recommend finding another acceptable solution for now. Depending on the typical size of your result sets, you can sort in memory, for example.
http://code.google.com/p/datanucleus-appengine/ - Jason On Fri, Oct 30, 2009 at 10:06 AM, Zach <[email protected]> wrote: > > So I am trying to do 2 sequential queries in app-engine to get around > the problem of only being able to primary sort on the property that an > inequality is done on. The problem is that setCandidates(Collection) > doesnt actually appear to set the candidates to query against. Pseudo- > code below. > > Query ageQuery = persistenceManager.newQuery(PersistentObject.class); > ageQuery.setFilter("age < ageMax"); > ageQuery.declareParameters("Integer ageMax"); > QueryResult unsorted = ageQuery.execute(25); > > Query sortQuery = persistenceManager.newQuery(PersistentObject.class); > sortQuery.setOrdering("dateCreated desc"); > sortQuery.setCandidates(unsorted); > QueryResult sorted = sortQuery.execute(); > > Also, one can verify that setCandidates doesn't work with something > like below > > Query query= persistenceManager.newQuery(PersistentObject.class); > query.setCandidates(new ArrayList()); > QueryResult sorted = qujery.execute(); > > because sorted.size()!=0. Has anyone else ran into this problem? Am > i doing something wrong? > > Thanks in advance for the help. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~----------~----~----~----~------~----~------~--~---
