No problem, Hibernate can do it. Show us the mapping you did... Even if it doesn't work yet...
I'd advice you to first create a javabean class that will have only those two properties and their getter/setter. This class will obviously represent the primary key/foreign key. You'll then use it in the mapping, read the reference doc:
* How to map a composite-id:
http://www.hibernate.org/hib_docs/v3/re ... ompositeid
This will give you a mapping like:
Code:
<composite-id class="YourId" mapped="true">
<key-property name="yourFirstProp"/>
<key-property name="yourSecondProp"/>
</composite-id>
* How to use it in a foreign-key mapping. In your case, you say this is a one-to-many relationship, so it means that it's kind of a collection mapping that you need. So you simply need to map a usual collection on the "one" side, and map the foreign-key on the "many" one (quite in a way close to what you'd with SQL: the constraint can only be from the collection elements to the container, not the contrary).
Declare a field of YourId type in the child element and map it this way:
Code:
<many-to-one name="region" >
<column name="yourFirstProp" not-null="true" />
<column name="yourSecondProp" not-null="true" />
</many-to-one>
Hope this helps, bye suzie.