Sorry, I should have been more explicit. Just for the record, we are talking about this:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned_Relationships With JPA+RDBMS a relationship between two objects (say, "Invoice" and "Customer") could be implemented by a "customer" attribute inside the "Invoice" class. In the RDBMS, this is translated to a CUSTOMER_ID column in the INVOICE table. Datanucleus does not support this (the relationship must be owned, that is, the Invoice class must be nested inside the Customer instance), otherwise you must do this by hand, managing the Key instance yourself (if I understood correctly). What I don't get is the rationale behind this. On Sat, Oct 24, 2009 at 12:17 PM, datanucleus <[email protected]>wrote: > > > Now that we are discussing it, I am curious: why does datanucleus only > > support owned relationships? There is not that much difference between > the > > typical Foreign Key field and a GAE Key property. > > JDO and JPA support **object** relationships, being Java standards for > O-O persistence. > Having a field of type "List<Key>" (or "Key" for 1-1), assuming that > is what you mean by "unowned" relationships, is not an object > relationship; it's a List of key objects. > When a user persists the object, it will store the List of keys, but > has no way of knowing where those objects are, so can't store them > itself; that's for the user to do. > When a user retrieves the object this would retrieve the List ... of > Keys. What the user does with those keys is for them to determine, > since their object only refers to the Keys. > That is O-O. How do you expect this to be different ? and why does > that imply that JDO doesn't support "unowned relationships" ? > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
