Hi,

I have two entities - Parent and Child, the relationship is "mapped"
using the mappedBy annotations.

Both entities are using Key type as the pk, which is manually
generated during the instantiation of the object.

When the PK is generated for the Child, parent information in the
child key is omitted because both parent and child are not yet
persisted. However, after persisting the parent and then the child.
The child's key changed because parent key information is appended to
the child's key, and currently I could not find a way to retrieve the
updated key without additional queries after pm.makePersistent
(childEntity) is called.

Now this is my question. How do I retrieve the updated Key? I have
tried pm.detachCopy(childEntity) with no result. Could someone please
give me some advice? Do I need to manually append parent key with
KeyFactory.Builder? If so, I do I achieve it with the Key type?

Thanks in advance

Michael

--

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