I'm pretty new to the JDO/GAE world, and I'm having some troubles
grasping the entity relationship models. I have read about entity
groups and parent keys but I can't seem to implement it correctly in
my example.

I started by trying to model my entities the same way I have done it a
million times with JPA and relational databases (see below), but it is
not working right. The first error I receive is trying to query for a
Team by a manager (select from team where manager==managerParam), I
get an error "Key of parameter value does not have a parent". So
obviously my relationships are not right. I haven't even gotten to the
Collection<Player> yet, since I can't get a simple relationship
working....

Any help would be appreciated!


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Manager {

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key id;

        @Persistent
        private User user;
}


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Team {

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key id;

        @Persistent
        private String name;

        @Persistent
        private Manager manager;

        @Persistent
        private Collection<Player> players;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Player {

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key id;

        @Persistent
        private String name;
}


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

Reply via email to