title: Apache Cayenne many-to-many relationship
body: <p>I'm new with Apache Cayenne.</p>
  
  <p>I have only one Entity, called Product.
  This entity has a many-to-many relationship with itself, that is a product can contain products, and it can be contained by other products.</p>
  
  <p>I can't model this relationship with Cayenne..
  What I do is:
  1) I create a table called Composition, with two fields that are both PKs and FKs.
  2) I create two toMany from Product to Composition (one from product.id to Composition.contained_id, and one from product.id to Composition.base_id)
  This should work with the DB
  Now I create only one ObjEntity: Product.
  But.. How can I create a flattened relationship?? I'm following this: <a href="http://cayenne.apache.org/doc/cayennemodeler-flattened-relationships.html" rel="nofollow">http://cayenne.apache.org/doc/cayennemodeler-flattened-relationships.html</a> but maybe because it is a relationship with itself I cannot select an Entity in "Target" combo box..</p>
  
  <p>Thank you
  Francesco</p>
  
  <p>EDIT: the target checkbox problem there is also if the two entities are different. Cayenne Modeler v.3.0.2</p>