In my self referencing object scenario the one-to-one properties do not get reflected in database (no appropriate columns are there). What's amazing to me - the criteria queries with criteria "IsNull" on such property does not produce errors... I am using NH 1.2. Please help me with this - I have no idea about it. Being honest I am using one-to-one relationship very seldom. Maybe because I've never been satisfied with the way it works (i.e. lazy loading).
Following is the mapping of my scenario:
Code:
<class name="Task">
<id name="Id">
<generator class="native" />
</id>
<property name="TaskState" not-null="true" />
<one-to-one name="Previous" lazy="proxy" />
<one-to-one name="Next" lazy="proxy" />
<joined-subclass name="...">
<key column="`TASK_ID`" />
. . .
</joined-subclass>
<joined-subclass name="...">
<key column="`TASK_ID`" />
. . .
</joined-subclass>
</class>