测试了一下,在表A中:
<one-to-one name="test2" fetch="join" constrained="false" cascade="all" class="com.yourcompany.hibernate.mapping.Test2" />
在表B中:
<one-to-one name="test" property-ref="OId" class="com.yourcompany.hibernate.mapping.Test" />
这样总提示property not found: OIdin entity: com.yourcompany.hibernate.mapping.Test,应该是property-ref出问题了,应该怎么写呢,指定关联的外键,我换成字段名,外键名都提示这个错误在主表的类中已经建立了Test2 test2 这个属性