The first one :-) On 22 February 2012 21:01, Peter Han <[email protected]> wrote:
> situation: > - user entities in db (properties id, name, sex, age) > - you want to get the oldest of them with min. age 10 > > createQuery(select u from User u where u.age>=10 order by age desc) > query.setMaxResults(1) !!! > query.getResultList(); > > how GAE handles this situation? > > 1. search in index table where age>=10 and only the oldest > 2. found 1 entity key > 3. read entity > 4. return entity > > OR > > 1. find all of them in index table where age>=10 > 2. found X entity keys > 3. read all entities > 4. return only the oldest of them (because JPA maxResults=1) > > Thanks > > -- > 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. > > -- 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.
