title: how to model a friends system with persistency layer?
body: <p>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. </p>
  
  <p>My idea was to do the following: </p>
  
  <p>User Object: </p>
  
  <pre><code>@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&lt;Connection&gt; IncConnections;
  
  @OneToMany(cascade={CascadeType.ALL},mappedBy="initiator")
  private List&lt;Connection&gt; OutConnections;
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@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;
  }
  </code></pre>
  
  <p>But when i try this i get the error: 
  App Engine ORM does not support multiple parent key provider fields</p>
  
  <p>So does anyone have an other idea how to model a friend system without using multiple parent keys? </p>
  
  <p>Hope someone can help!</p>