I took a look at your requirements more carefully - Table B is a join table between Table A and Table C. I misunderstood that initially. Given that Table A has a composite key, I'm stumped as to how to do it.
I think you want a mapping for Table A as follows that handles the composite key and the non-key column:
Code:
<hibernate-mapping>
<class name="A" table="A">
<composite-id>
<key-property name="atr1" type="string" column-name="atr1">
<key-property name="atr2" type="string" column-name="atr2">
</composite-id>
<property name="atr3" type="string" column-name="atr3">
</class>
</hibernate-mapping>
The mapping for Table C is straightforward since it has a non-composite key - you can just use an <id> tag for the primary key column.
The question becomes how to do the mapping for Table B. I was thinking you'd do a <composite-id> with a <key-many-to-one> to map the Table A foreign key columns and another <key-many-to-one> to map the Table C foreign key columns. It looks like the <key-many-to-one> syntax allows you to specify multiple nested <column> tags, but I'm not sure how you map the columns into the distinct Java properties.
Sorry to send you down the wrong path with my original response. I misunderstood the table structures.
Sarah