Hi
I guess you need to specify all the column in composite key in your key column.
Code:
<class name="hci.weblog.model.UserGoals" table="UserGoals">
<composite-id>
<key-property name="idPatient" column="idPatient" type="integer"/>
<key-property name="idGoalType" column="idGoalType" type="integer"/>
<key-property name="idGoals" column="idGoals" type="integer"/>
</composite-id>
<set name="GoalType" sort="hci.weblog.model.GoalType" table="GoalType" inverse="true" lazy="false" cascade="none">
<key>
<column="idPatient"/>
<column="idGoalType"/>
<column="idGoals"/>
</key>
<one-to-many class="hci.weblog.model.GoalType" />
</set>
<set name="Goals" sort="hci.weblog.model.Goals" table="Goals" inverse="true" lazy="false" cascade="none">
<key>
<column="idPatient"/>
<column="idGoalType"/>
<column="idGoals"/>
</key>
<one-to-many class="hci.weblog.model.Goals" />
</set>
</class>
In case of not using composite key your mapping will work.