Look at the 5.9 section of the hibernate reference guide.
The many-to-many sample applies to you.
Quote:
You may specify a bidirectional many-to-many association simply by mapping two many-to-many associations to the same database table and declaring one end as inverse. Heres an example of a bidirectional many-to-many association from a class back to itself:
Code:
<class name="eg.Node">
<id name="id" column="id"/>
....
<bag name="accessibleTo" table="node_access" lazy="true">
<key column="to_node_id"/>
<many-to-many class="eg.Node" column="from_node_id"/>
</bag>
<!-- inverse end -->
<bag name="accessibleFrom" table="node_access" inverse="true" lazy="true">
<key column="from_node_id"/>
<many-to-many class="eg.Node" column="to_node_id"/>
</bag>
</class>