当主外键为同一字段时可以使用一对一的延迟加载
具体配置如下
< one-to-one name = "settleEnterRedo" cascade = "all" constrained = "true" class = "com.agr.settle.entity.enter.SettleEnterRedo" >
</ one-to-one >
< class name = "SettleEnterRecord" table = "SETTLE_ENTER_RECORD" lazy = "true" >
1、 当使用一对一延迟加载时, <one-to-one> 标签要添加 constrained = "true" 属性
2、 在 <class> 标签中添加 lazy = "true" 属性