title: Jpa - Two @OneToOne relations with same 'mappedBy'
body: <p>I have two java-classes / db-tables: 'message' and 'thirdparty'</p>
  
  <pre><code>@Entity
  public class Message {
      @OneToOne(mappedBy = "message")
      private ThirdParty source = null;
  
      @OneToOne(mappedBy = "message")
      private ThirdParty target = null;
  
      ....
  }
  
  @Entity
  public class ThirdParty {
      @OneToOne(targetEntity = Message.class)
      @JoinColumn(name = "Message", referencedColumnName = "mess_id", nullable = false)
      private Message message = null;
  
      @Column(name = "isSource", nullable = false)
      private Boolean isSource = null;
  }
  </code></pre>
  
  <p>Message has two references to ThirdParty, which could be differenced by isSource (if they are source or target).</p>
  
  <p>This cannot be resolved by jpa they way it is designed / annotiated. But is there a way to to this by adding some annotiation or some kind of special sql-statement?</p>