Hi John. No, you can persist both entities in a single transaction. Just
follow the example in the documentation:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned_One_to_One_Relationships

If you create new ContactInfo and Employee objects, then associate the
objects using the Employee class' setContactInfo method, calling
makePersistent(employee) will persist the ContactInfo object as well.

- Jason

On Fri, Aug 21, 2009 at 11:22 PM, jd <[email protected]> wrote:

>
> Hi,
>
> I want to create an owned one to many relationship where the key for
> the parent is auto generated.
>
> Is this possible to to in a single transaction?  Or do I need to
> commit the parent first so I can then get its key and set the parent
> key on the child?
>
> Thanks,
>
> John
> >
>

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