Check out:
http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html#mapping-declaration-onetoone
I hunted down the sample they refer to:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.hibernate.test.onetooneformula">
<class name="Person">
<id name="name"/>
<one-to-one name="address" cascade="all" constrained="false">
<formula>name</formula>
<formula>'HOME'</formula>
</one-to-one>
<one-to-one name="mailingAddress" constrained="false">
<formula>name</formula>
<formula>'MAILING'</formula>
</one-to-one>
</class>
<class name="Address" batch-size="2"
check="addressType in ('MAILING', 'HOME', 'BUSINESS')">
<composite-id>
<key-many-to-one name="person"
column="personName"/>
<key-property name="type"
column="addressType"/>
</composite-id>
<property name="street"/>
<property name="state"/>
<property name="zip"/>
</class>
</hibernate-mapping>
-David