david wrote:
One-to-one joined by primary composite key is no problem. Have you tried using the same key class for both entities?
Does this work in Hibernate 2.1?
The docs for mapping a one-to-one from Person to Employee show the following:
<class name="person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="foreign">
<param name="property">employee</param>
</generator>
</id>
...
<one-to-one name="employee"
class="Employee"
constrained="true"/>
</class>
Now, wouldn't my id be a <composite-id> instead of an <id> element, and if so, now I cant specify a generator of foreign??