class Staff{
private Contract con;
}
Staff s = (Staff)session.get......
为啥 s.getCon().getId() == 0 呢
配置文件如下
-----------------
<one-to-one name="contract" class="cn.xyurp.rsgl.bean.Contract" entity-name="ContractCon" cascade="all"
property-ref="staffContract" constrained="true">
</one-to-one>
<many-to-one name="staffContract" entity-name="StaffContract" class="Staff" column="staffId" unique="true">
</many-to-one>
private Contract con;
}
Staff s = (Staff)session.get......
为啥 s.getCon().getId() == 0 呢
配置文件如下
-----------------
<one-to-one name="contract" class="cn.xyurp.rsgl.bean.Contract" entity-name="ContractCon" cascade="all"
property-ref="staffContract" constrained="true">
</one-to-one>
<many-to-one name="staffContract" entity-name="StaffContract" class="Staff" column="staffId" unique="true">
</many-to-one>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货