title: How to use common entity in more than one entity
body: <p>I have one entity <code>Address</code> and  this entity is owned by two other entities.</p>
  
  <p>Ex</p>
  
  <p><code>@JoinColumn</code> and <code>mappedBy</code> use foreign key either for <code>User</code> or  <code>Company</code>. 
  How to fix this problem to work address for both user and company?</p>
  
  <p>I've tried <code>@JoinColumn</code> and <code>mappedBy</code>, but no luck.</p>
  
  <pre><code>@Entity
  class User {
      ...
      @OneToMany
      private List&lt;Address&gt; address;
      ...
  }
  
  @Entity
  class Company{
      ...
      @OneToMany 
      private List&lt;Address&gt; address;
      ...
  }
  
  @Entity
  class Address {
      private String street;
      private String city;
      private String state;
  
      private String entityType; // User or Company
      private String entityId; // id of User or Company 
  }
  </code></pre>