Sorry, I am using Objectify so here's the low level api examples to
accomplish the same thing:

Max age...
Query query = new Query("YourEntityType");
query.addSort('age',Query.SortDirection.DESCENDING);
List<YourEntityType> list =
DatastoreServiceFactory.getDatastoreService().prepare(query).asList(withLimit(1));

Least age...
Query query = new Query("YourEntityType");
query.addSort('age',Query.SortDirection.ASCENDING);
List<YourEntityType> list =
DatastoreServiceFactory.getDatastoreService().prepare(query).asList(withLimit(1));


Jeff

On Sat, Dec 4, 2010 at 11:43 AM, YF CAO <[email protected]> wrote:

> Hey all.
> i am coding in java.
>
> To: Jeff Schwartz
> Instance of Query has not order method.
> i am using Google App Engine for Java 1.3.7
>
>
> 2010/12/5 Jeff Schwartz <[email protected]>
>
>> Conceptually they are tables, but not in the same sense as SQL tables.
>> They are more like a hash map and if you think of them in those terms you
>> will be better served.
>>
>> Are you coding in Python or Java. If you are coding in Java then here's an
>> example:
>>
>> query(Some.class).order('age').limit(1).get()
>>
>>
>> On Sat, Dec 4, 2010 at 11:16 AM, Zeynel <[email protected]> wrote:
>>
>>> On Dec 4, 11:08 am, Tim Hoffman <[email protected]> wrote:
>>> > Remember there are no tables. Just kinds representing models.
>>>
>>> I am confused by this statement. When I look at the Development
>>> Console - Datastore Viewer; I see a table named after the model. In my
>>> case, I have a table called User with columns "userEmail", "userName"
>>> and so on. Each row in this table is what the documentation calls an
>>> "instance" of the class. So what is the justification for the
>>> statement that there are no tables?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<google-appengine%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine?hl=en.
>>>
>>>
>>
>>
>> --
>> *Jeff Schwartz*
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-appengine%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>



-- 
*Jeff Schwartz*

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en.

Reply via email to