Hi Lucian,

> Is there a way to query for entities based on their grandparent?
>
> For example, suppose we have a root A entity, a B entity having A as
> parent, and a C entity having B as parent (A <- B <- C). Is is
> possible to query for all C entities in the database that have A
> entity as grand parent?
>
Unfortunately, AppEngine JDO does not support such a query,
but Low Level API supports an ancestor query, as follows:

DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
ds.prepare(new Query("C",
grandparentKey)).asList(FetchOptions.Builder.withOffset(0));

Hope this helps,

Yasuo Higa

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to