Hi.

I'm using Google App Engine and I really liked it. It was a bit
difficult in the beginning because there are more documentation for
Python and I only know Java but now I think I'm going well.

I'm using JDO and I understand that do add a child to a one to many
relationship I need to do this:

User user = pm.getObjectById(User.class.getName(), "thiago");
LoginHistory loginHistory = new LoginHistory(now);
loginHistory.setKey(user.getKey().getChild(LoginHistory.class.getName(),
now.getTime());
user.getLoginHistory(loginHistory);
pm.close();

I loginHostory has to have User as the parent, so User("thiago")/
LoginHistory([time]). I can't do makePersistent(myChild) because it
won't appear in the collection or anywhere with user, so I don't know
how JDO makes the link with the collection because I can't see in the
Datastore Viewer.

But my real question is: I have an entity and the collection is really
big, like user.getLoginHistory(), and I think after a lot of logins it
will be wrong to retrieve this collection just to add a new child.
Isn't there any way to create a child in a collection without using
the parent? Something like makePersistent(newChild) and newChild have
the key like I said? Or how can I do this using Datastore (low level
API)? I can't see the property with the collection in the Datastore
viewer.

Thank you very much.

PS: Sorry for my English, I'm brazilian.

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