If a primary key comprises more than one column, the primary identifier can have multiple attributes mapped to these columns. In some cases, the primary key column could also be the foreign key column.
In the above example, the Assignment class has a primary identifier with three attributes: one basic type attribute and two migrated attributes. The primary identifier mapping is as follows:
<composite-id> <key-property name="type"> <column name="type" sql-type="smallint" not-null="true"/> </key-property> <key-many-to-one name="title"> </key-many-to-one> <key-many-to-one name="worker"> </key-many-to-one> </composite-id>