title: JPA mapping issue when mapping two entities with same `JoinColumn`
body: <p>I'm having some weird situation, where I have for example an entity called <strong>Article</strong>, which has a relation to <strong>Supplier</strong>, but also to <strong>Supplier Contact Person</strong>. For example:</p>
  
  <p><img src="https://i.stack.imgur.com/yzWzV.png" alt="ERD"></p>
  
  <p>Supplier is linked to Article by Supplier_Id, while ContactpersonSupplier is linked to Article by both Supplier_Id (to SupplierId) and Supplier_Contactperson_Id (to Id).</p>
  
  <p>So, right now we mapped all relations on <code>Article</code>:</p>
  
  <pre><code>@JoinColumn(name = "Supplier_Id")
  private Supplier supplier;
  
  @JoinColumns({
    @JoinColumn(name = "Supplier_Id"),
    @JoinColumn(name = "Supplier_Contactperson_Id")
  private SupplierContactperson supplierContactperson;
  </code></pre>
  
  <p>This does not work because we're mapping <strong>Supplier_Id</strong> twice, once for <code>supplier</code> and once for <code>supplierContactperson</code>. If you do this, you get the following exception:</p>
  
  <pre><code>org.hibernate.MappingException: Repeated column in mapping for entity: Article column: Supplier_Id (should be mapped with insert="false" update="false")
  </code></pre>
  
  <p>In a normal situation you would link them up like this: <code>Article</code> -> <code>ContactpersonSupplier</code> -> <code>Supplier</code>, and then there would be no problems.</p>
  
  <p>However, <code>ContactpersonSupplier</code> is not required, but <code>Supplier</code> is required. This means that if we leave the contactperson away, we can't provide a supplier.</p>
  
  <p>We cannot use <code>insertable = false, updatable = false</code> for the very same reason, if we put these values on <code>supplier</code>, we cannot add a supplier if the contactperson is not provided.<br>
  We cannot add them on <code>supplierContactperson</code> either, because JPA/Hibernate requires you to put it on all <code>@JoinColumn</code>'s inside a <code>@JoinColumns</code>, and if we do that, we can't save a contactperson.</p>
  
  <p>One idea we have is to simply map the IDs, in stead of using related entities, but we're wondering if there's an alternative approach that might work. So the question is, how should we solve this mapping issue?</p>
  
  <p><em>One thing to mention though, the data structure cannot be changed.</em></p>