Many to many relationships aren't natively supported. You have to keep
your own set of keys. See 
http://code.google.com/appengine/docs/java/datastore/relationships.html

Stephen

On Jul 31, 10:38 am, Erencie <[email protected]> wrote:
> I want to create a many-to-many relationship between Student class and
> Course class. The rationale is that one Course contains many Student
> objects and one Student object can contain many Course objects as
> well.
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> class Student {
>  ...
>
> @Persistent
> List<Course> courses;
> ..
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> class Course {
> ...
> @Persistent
> List<Student> students;
> ...}
>
> Then there is problem when I'm persisting a Student object to the
> datastore. I did remember to take care of both sides.
>
> Can anyone tell me what's going wrong here?

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