True. I had forgotten about the unowned relationships, but I think again I
will need to retrieve the collections in order to add the new Key, right? Of
course it's much better to retrieve a collection of keys than a collection
of entities. And maybe making the relationship from the LoginHistory to User
instead of User having a collection is a better idea, so only when I need to
show the history I will make this query…

I think inverting the relationship is a better idea.

Thanks.

On 4 July 2011 18:33, objectuser <[email protected]> wrote:

> For something large like that, I think you'll want to make your
> relationship from User to LoginHistory an unowned relationship.  That simply
> means that LoginHistory will store an ID that points to User instead of User
> having a collection of LoginHistory objects.  The Google docs have more on
> that 
> here<http://code.google.com/appengine/docs/java/datastore/jdo/relationships.html>.
>  I have blogged a bit about relationship models, the most relevant being
> this 
> one<http://objectuser.wordpress.com/2009/05/31/queries-in-gae-one-to-many/>,
> which you might find helpful (defer to Google's docs over mine, of course).
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine-java/-/F4XUC978UdsJ.
> 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.
>

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