Having mapping like this:
@Entity
public class EntityA implements Serializable {
@Id
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
@Entity
public class EntityB implements Serializable {
@Id
@ManyToOne
private EntityA entityA;
public EntityA getEntityA() {
return entityA;
}
public void setEntityA(EntityA entityA) {
this.entityA = entityA;
}
}
which is same as example 4 case (a) in section 2.4.1.3 of JPA 2.2 Specification. When EntityManagerFactory is used to lookup EntityType of EntityB:
EntityType<EntityB> entityTypeB = emf.getMetamodel().entity(EntityB.class);
Methods of retrieved EntityType instance cannot locate id attributes of persistend type EntityB |