Because A is the entity group parent of B, the key of an instance of B
must contain information about its entity group parent instance of A.

Instead of using b.key.getId() in

  // We cannot retrieve this object. Why?
  B newB = pm.getObjectById(B.class,b.key.getId());

you might care to use the KeyFactory.Builder class as detailed in

"http://code.google.com/intl/en/appengine/docs/java/datastore/
creatinggettinganddeletingdata.html#Creating_and_Using_Keys"

in order to build a key instance which contains information about both
your B instance and its parental A instance.

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