Your mapping is wrong, this is the correct mapping. On the many-to-one side, a column name is a column in the same table that is foreign, referring to the primary key of Person.
<class name="com.abc.domain.PersonConnect" table="PERSON_CONNECT"> <composite-id> <key-many-to-one name="Parent" class="com.abc.domain.Person" column="PARENT_PERSON_ID"/> <key-many-to-one name="Child" class="com.abc.domain.Person" column=" CHILD_PERSON_ID"/> </composite-id> </class>
source share