class B{
@Any(metaColumn = @Column(name = "ITEM_TYPE"))
@AnyMetaDef(idType = "long", metaType = "string",
metaValues = {
@MetaValue(targetEntity = A.class, value = "A")
})
@Cascade( { org.hibernate.annotations.CascadeType.ALL})
@JoinColumn(name = "ITEM_ID")
private A a;
...
...
}
我试图加入一个表和表B中 where B.item_type ='A'
是恒定的 , B.item_id= A.id
。
这是我扔
Caused by: org.hibernate.MappingException: Foreign key (FKi1uuph2wrvxtx66s7n7i1s09a:B [item_type,item_id])) must have same number of columns as the referenced primary key (A [id])
如何将我这个映射使用JPA春季和休眠的任何帮助吗?