[appengine-java] Re: JDO: how to add a child without the collection

2011-07-04 Thread objectuser
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.
 
 I have blogged a bit about relationship models, the most relevant being 
this 
one, 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: JDO: how to add a child without the collection

2011-07-04 Thread Thiago Rossi
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  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.
>  I have blogged a bit about relationship models, the most relevant being
> this 
> one,
> 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
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> 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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: JDO: how to add a child without the collection

2011-07-07 Thread objectuser
You're right.  I confused the two: I said unowned while actually describing 
inverting the relationship.  Do I get half a point? ;)

-- 
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/-/TCzZ-0Xd5sIJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.