title: Many to many relationship with additional created Timestamp column in JPA 2.1
body: <p>My Entities could have one directional relationship between them. 
  (Entity is a dummy name)</p>
  
  <pre><code>@Entity
  public class Entity {
      ...
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Integer Entity_id;
      ...
      @ManyToMany()
      @JoinTable(name = "Entity2Entity", joinColumns =
      @JoinColumn(name = "EntityLeft_id", referencedColumnName="Entity_id"), inverseJoinColumns =
      @JoinColumn(name = "EntityRight_id", referencedColumnName="Entity_id"))
      private Set&lt;Entity&gt; Left2Right = new HashSet&lt;Entity&gt;();
  
      @ManyToMany(mappedBy = "Left2Right")
      private Set&lt;Entity&gt; Right2Left = new HashSet&lt;Entity&gt;();
  </code></pre>
  
  <p>But I want to extend this relationship with an plus Timestamp data column.</p>
  
  <p><a href="https://i.stack.imgur.com/fyE5y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fyE5y.png" alt="enter image description here"></a></p>
  
  <p>Is ther a way to do this with the EclipseLink 2.5 api? </p>
  
  <p>If not, I read that I can do this with OneToMany connections, but I dont know how.</p>
  
  <p>I created an Entity for Entity2Entity too:</p>
  
  <pre><code>@Entity
  public class Entity2Entity {
      ...
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Integer Entity2Entity_id;
  
      private Entity EntityLeft_id;
  
      private Entity EntityRight_id;
  
      @Temporal(TemporalType.TIMESTAMP)
      @Column(name = "created", nullable = false, columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable=false, updatable=false)
      private java.util.Date created;
  </code></pre>
  
  <p>But I could not connect them.</p>