Could you pls tell, is it possible to use 2 composite-id in a single mapping like the following code snippet. If it's wrong how to use 2 referance variable in a single hbm. ----------------------------------------------------------------------- Table Name: employee coulmn : empNo,Name,Address. constrain(empNo,Name)
class A { private B obj1; private C obj2; private String address; get/set(); }
class B { private int emp_no; get/set(); }
class C { private String name; get/set(); }
mapping:
<class name="A" table="employee"> <composite-id name="obj1" class="B"> <key-property name="emp_no" type="int" column="empNo"/> </composite-id>
<composite-id name="obj2" class="C"> <key-property name="name" type="string" column="name"/> </composite-id>
<property name="address" column="Address" type="string"/>
</class> ---------------------------------------------------------------------------------
|