Hi
Here is the mapping file for your requirment
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="lk.wts.test.Employee"
table="Employee"
>
<composite-id
>
<key-property
name="national_id"
type="java.lang.String"
column="national_id"
/>
<key-property
name="passport_id"
type="java.lang.String"
column="passport_id"
/>
</composite-id>
<many-to-one
name="emp"
class="lk.wts.test.Employee"
cascade="none"
update="false"
insert="false"
>
<column name="parent_national_id" ></column>
<column name="parent_passport_id"></column>
</many-to-one>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
/>
<property
name="parent_national_id"
type="java.lang.String"
update="true"
insert="true"
column="parent_national_id"
/>
<property
name="parent_passport_id"
type="java.lang.String"
update="true"
insert="true"
column="Parent_passport_id"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Employee.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Amila
(Don't forget to rate if helps)