How can fix this thing
Repeated column in mapping for entity: com.abc.domain.PersonConnect column: PERSON_ID (should be mapped with insert="false" update="false")
this is snippet from my hbm file
<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>
<many-to-one class="com.abc.domain.Person" fetch="select" name="parent" lazy="false" >
<column length="20" name="PERSON_ID" not-null="true"/>
</many-to-one>
<many-to-one class="com.abc.domain.Person" fetch="select" name="child" lazy="false" >
<column length="20" name="PERSON_ID" not-null="true"/>
</many-to-one>
</class>
and the table goes like this
Your mapping is wrong, this is the correct mapping. On the many-to-one side the column name is the column in the same table which is a foreign referring 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>