ITPub博客

首页 > 应用开发 > Java > hibernate中 one to many和many to one的非主键关联

hibernate中 one to many和many to one的非主键关联

原创 Java 作者:livedba 时间:2011-11-17 20:26:56 0 删除 编辑

Many to one:
update="false" insert="false"
class="com.alcatel.asb.hdm.report.etkt.entity.AreaCodeMapping">

关键使用property-ref

One to many:
使用property-ref.
23.4.5. Associations on alternate keys





property-ref="person"
cascade="all"
fetch="join"/>
inverse="true">
property-ref="userId"/>
















column="userId"
property-ref="userId"/>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25261409/viewspace-1056382/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-01-21

最新文章