Hi am i'm trying the new Java support for google app engine, and i am trying to make a persistency layer for all my objects. I am trying to model a friend connection but am running into problems. I use JPA to persist the objects and define my persistency objects with JPA annotations.
My idea was to do the following:
User Object:
@Entity
public class User {
@Column(name="user_id")
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
private String id;
@OneToMany(cascade={CascadeType.ALL},mappedBy="invitee")
private List<Connection> IncConnections;
@OneToMany(cascade={CascadeType.ALL},mappedBy="initiator")
private List<Connection> OutConnections;
}
.
@Entity
public class Connection {
@Column(name="connection_id")
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
private String id;
@ManyToOne(cascade={CascadeType.ALL})
User initiator;
@ManyToOne(cascade={CascadeType.ALL})
User invitee;
}
But when i try this i get the error: App Engine ORM does not support multiple parent key provider fields
So does anyone have an other idea how to model a friend system without using multiple parent keys?
Hope someone can help!