title: What is “the inverse side of the association” in a bidirectional JPA OneToMany/ManyToOne association?
body: <p>In the example section of the <a href="https://docs.oracle.com/javaee/7/api/javax/persistence/OneToMany.html" rel="noreferrer"><code>@OneToMany</code> JPA annotation reference</a>:</p>
  
  <p><strong>Example 1-59 @OneToMany - Customer Class With Generics</strong></p>
  
  <pre><code>@Entity
  public class Customer implements Serializable {
      ...
      @OneToMany(cascade=ALL, mappedBy="customer")
      public Set&lt;Order&gt; getOrders() { 
          return orders; 
      }
      ...
  }
  </code></pre>
  
  <p><strong>Example 1-60 @ManyToOne - Order Class With Generics</strong></p>
  
  <pre><code>@Entity
  public class Order implements Serializable {
      ...
      @ManyToOne
      @JoinColumn(name="CUST_ID", nullable=false)
      public Customer getCustomer() { 
          return customer; 
      }
      ...
  }
  </code></pre>
  
  <p>It seems to me that the <code>Customer</code> entity is the owner of the association. However, in the explanation for the <code>mappedBy</code> attribute in the same document, it is written that:</p>
  
  <blockquote>
    <p>if the relationship is bidirectional,
    then set the mappedBy element on the
    inverse (non-owning) side of the
    association to the name of the field
    or property that owns the relationship
    as Example 1-60 shows.</p>
  </blockquote>
  
  <p>However, if I am not wrong, it looks like in the example, the <code>mappedBy</code> is actually specified on the owning side of the association, rather than the non-owning side.</p>
  
  <p>So my question is basically:</p>
  
  <ol>
  <li><p>In a bidirectional (one-to-many/many-to-one) association, which of the entities is the owner? How can we designate the One side as the owner? How can we designate the Many side as the owner?</p></li>
  <li><p>What is meant by "the inverse side of the association"? How can we designate the One side as the inverse? How can we designate the Many side as the inverse?</p></li>
  </ol>