Not sure why the datastore needs to know that a Car is associated with a particular User. There is no easy way for the datastore to handle cascading deletes in a M-to-M relationship w/o reference counting. Also setting the Fetch policy to load children with the parent load is not an option due to them being in separate entity groups.
Regardless, you can use *getObjectById<http://db.apache.org/jdo/api23/apidocs/javax/jdo/PersistenceManager.html#getObjectById%28java.lang.Class,%20java.lang.Object%29> *(java.lang.Class<T> cls, java.lang.Object key) to verify the Key is referencing a particular class and an object exists. On Wed, Oct 6, 2010 at 2:15 PM, hadf <hadrien.for...@gmail.com> wrote: > Hello, > > I read that many to many relation ship must resolved by using sets of > Key. > But what I don't understand is how do I specify the type the Key is > referencing. > I mean that if I have a many to many relation ship between Car and > User, how jpa or jdo knows that Car is associated to User ? > > public class Car { > @OneToMany > private Set<Key> users; //this relation ship is untyped > } > > -- > 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-j...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@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-j...@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.