Hello,
I am a newbie to Datastore. Here's what I am trying to accomplish:
Trying to set an "Unowned" one-to-many relationship between 2 objects. (I
chose "unowned" because I wasn't sure if I could have an "owned"
many-to-many. Also wasn't sure if "lazy loading" is available for the
children. Is "owned" the recommended way?)
Anyway, I have a *Parent *class in which I have this...
@Persistent
private Set<Key> children = new HashSet<Key>();
In the *Child *class I have this...
@Persistent
private Key parent = null;
I am doing the following:
1) Create a Parent.. This worked. The parent.getId() gives me the Id.
2) While creating a child, I want to attach the child to parent, so I tried
several variations such as this:
String parentId = parent.getId().toString();
child.setParent(KeyFactory.stringToKey(parentd));
This is NOT working. What's the best way to do this?
3) Also, I need to put the key of child into Parent. As per, Max Ross'
presentation at Google I/O this doesn't work in the same transaction. Has
that issue been fixed?
Is there any tutorial available that shows this? Any help in this regard
will be greatly appreciated.
Thanks.
- Ajay
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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?hl=en
-~----------~----~----~----~------~----~------~--~---