Here is the mapping :
Code:
<class
name="Child"
table="CHILD"
dynamic-update="false"
mutable="true"
>
<id
name="id"
column="ID"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="sequence">
<param name="sequence">CHILD_SEQ</param>
</generator>
</id>
<many-to-one
name="parent"
class="Parent"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="PARENT_ID"
not-null="false"
/>
<property
name="activityCode"
type="java.lang.String"
update="true"
insert="true"
column="NAME"
/>
</class>
<class
name="Parent"
table="Parent"
dynamic-update="true"
mutable="true"
>
<id
name="id"
column="ID"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="sequence">
<param name="sequence">PARENT_SEQ</param>
</generator>
</id>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="NAME"
/>
<many-to-one
name="preferedChild"
class="Child"
cascade="all"
outer-join="auto"
update="true"
insert="true"
column="PREFERED_CHILD_ID"
not-null="true"
/>
</class>
[/code]