title: JPA Mapping and inheritance
body: <p>I have a mapping problem with JPA</p>
  
  <pre><code>@Entity
  @Table(name = "TBL_A")
  public class EntityA {
  
    // Other mappings
  
    @OneToMany(mappedBy = "entityA")
    private List&lt;EntityBImpl&gt; bEntities;
  
    @OneToMany(mappedBy = "entityA")
    private List&lt;AnotherEntityBImpl&gt; anotherBEntities;
  }
  
  @Entity
  @DiscriminatorValue("X")
  public class EntityBImpl extends AbstractEntityB {
  
    // Other mappings
  }
  
  @Entity
  @DiscriminatorValue("Y")
  public class AnotherEntityBImpl extends AbstractEntityB {
  
    // Other mappings
  }
  
  
  @Entity
  @Table(name = "TBL_B")
  @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
  @DiscriminatorColumn(name = "PROJ_TYPE")
  public abstract class AbstractEntityB {
  
    // Other mappings
  
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ENTITY_A_ID")
    private EntityA               entityA;
  }
  </code></pre>
  
  <p>It throws the following exception at runtime : </p>
  
  <p><strong>org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.example.EntityBImpl.entityA in com.example.EntityA.bEntities</strong></p>
  
  <p>How to solve the problem without having to change the inheritance strategy ?</p>