Something like:
Code:
<class name="Parent" ...>
<composite-id name="id" class="ParentPK" unsaved-value="none">
<key-property name="pkAttr1" column="pk_col_1" .../>
<key-property name="pkAttr2" column="pk_col_2" .../>
</composite-id>
...
<set name="children" lazy="true" table="messy_association_table" ...>
<key>
<column name="prnt_attr_1"/>
<column name="prnt_attr_2"/>
</key>
<many-to-many class="Parent">
<column name="child_attr_1"/>
<column name="child_attr_2"/>
</many-to-many>
</set>
</class>
And yes, this is all covered in the docs
http://www.hibernate.org/hib_docs/reference/en/html/components.html#components-compositeid