title: JPA JoinColumn vs mappedBy
body: <p>What is the difference between:</p>
  <pre><code>@Entity
  public class Company {
  
      @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY)
      @JoinColumn(name = &quot;companyIdRef&quot;, referencedColumnName = &quot;companyId&quot;)
      private List&lt;Branch&gt; branches;
      ...
  }
  </code></pre>
  <p>and</p>
  <pre><code>@Entity
  public class Company {
  
      @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY, 
      mappedBy = &quot;companyIdRef&quot;)
      private List&lt;Branch&gt; branches;
      ...
  }
  </code></pre>