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>