Relationship like below:
{code} @Entity public class EntityA implements Serializable { @Id private int id; {code}
{code} @Entity public class EntityB implements Serializable {
@Id @OneToOne @JoinColumn(name = "a_ref_id") private EntityA entityA; {code}
{code} @Entity public class EntityC implements Serializable {
@Id private String code; @ManyToOne @JoinColumn(name = "b_ref_id") private EntityB entityB; {code}
could cause org.hibernate.AnnotationException:
{code} javax.persistence.PersistenceException: [PersistenceUnit: fail_package_pu] Error performing schema management Caused by: org.hibernate.AnnotationException: A Foreign key refering com.jpatest.fail.db.EntityB from com.jpatest.fail.db.EntityC has the wrong number of column. should be 0
{code}
Occuring Occurring of this error depends on package name and entity name |
|