views:

33

answers:

2

I tried to add a property to my User class to get it to automatically load its child records (contacts).

According to the error below, this doesn't seem possible, at least the way I tried to do it:

 @Persistent(mappedBy = "user", defaultFetchGroup="true")
    private List<Contact> contacts;


WARNING: Meta-data warning for com.contactly.User.contacts: The datastore does not support joins and therefore cannot honor requ
ests to place related objects in the default fetch group.  The field will be fetched lazily on first access.  You can modify this warn
ing by setting the datanucleus.appengine.ignorableMetaDataBehavior property in your config.  A value of NONE will silence the warning.
  A value of ERROR will turn the warning into an exception.

Is there any other way to do this in JDO?

+1  A: 

No. The App Engine datastore doesn't support loading referenced entities at the same time as the results of a query.

Nick Johnson
How do you recommend quickly loading the referenced entities then? I've been trying to answer this question myself for 4 days without any luck.
culov
In Python, you can accumulate the keys for the referenced entities and do a batch fetch: http://blog.notdot.net/2010/01/ReferenceProperty-prefetching-in-App-Engine . I'm not sure if the same is possible in JDO.
Nick Johnson