Use the many-to-one in one direction and then one-to-one in the reverse direction as suggested in Chapter 6 of Hibernate in Action.
For example:
Code:
<class name="test.hibernate.Product" table="products">
....
<many-to-one name="productOne"
class="test.hibernate.ProductOne"
column="PRODUCT_ONE_ID"
cascade="save-update"
unique="true"/>
....
</class>
<class name="test.hibernate.ProductOne" table="products_one">
....
<one-to-one name="product"
class="test.hibernate.Product"
property-ref="productOne"/>
....
</class
This is also described in more detail in section 5.1.11 in the Hibernate Reference, and is refered to as "one-to-one with foreign key constraint".
Notice the cascade="save-update" on the Product side, so that when you save instances of Parent, its associated ProductOne gets saved also.
Hope this helps,
Kevin Hooke