To begin with, I don't think <key-many-to-one> is really that nice a feature. So, first, get rid of that ;-)
Create a pk class, FooBarKey, with the 3 pk attributes:
Code:
<class name="FooBar">
<composite-id name="id" class="FooBarKey">
<key-property name="foo_id"/>
<key-property name="bar_id"/>
<key-property name="common_id"/>
</composite-id>
<many-to-one name="foo" insert="false" update="false">
<column name="foo_id"/>
<column name="common_id"/>
</many-to-one>
<many-to-one name="bar" insert="false" update="false">
<column name="bar_id"/>
<column name="common_id"/>
</many-to-one>
....
</class>
We should add something like this to the wiki or doco or faq...