title: Create instance of the Entity in the Many side of ManyToOne Relationship
body: <p>I'm using <strong>Spring Data JPA</strong>.<br>
  I have the following Entities  </p>
  
  <p><strong>Person</strong> Entity </p>
  
  <pre><code>class Person{
  
  private String id;
  
  @OneToMany(mappedBy="owner")
  private List&lt;Contact&gt; contacts;
  ...
  
  }
  </code></pre>
  
  <p>And <strong>Contact</strong> Entity  </p>
  
  <pre><code>class Contact{
  
  private String id;
  
  @ManyToOne
  @JoinColumn(name="owner_id")
  private Person owner;
  ...
  
  }
  </code></pre>
  
  <p>When I want to create Contact instance,I'm confused about how to map owner details.</p>
  
  <pre><code>Contact contact = new Contact();
  contact.setOwner(?);
  </code></pre>
  
  <p>But while creating I will have only owner_id.<br>
  I want to set owner_id alone while creating, but to have association(while querying) I have mapped it to concrete class(Person).  </p>
  
  <p>I've tried this</p>
  
  <pre><code>class Contact{
  
  @Column("owner_id")
  private String ownerId;
  @ManyToOne
  @JoinColumn("owner_id")
  private Person pwner;
  
  } 
  </code></pre>
  
  <p>But its throwing error duplicate reference to owner_id.</p>
  
  <p><em>I don't want to query Person Table with owner_id and set that "Person" reference to set while creating contact.</em></p>
  
  <p><strong><em>I want to use owner_id while inserting and owner reference with which I may get owner details for a give contact.
  How to solve this.</em></strong></p>
  
  <p>Thanks in Advance. </p>