Hibernate version: 3.2.4.sp1
Name and version of the database you are using: Mysql 5.0.40 with InnoDB
I am having problems with bidirectional one-to-one association within a table per hierarchy mapping.
Basically I have a parent class A that has two different subclasses B and C. A has a many to one association to class B with the following mapping:
Code:
<many-to-one name="TargetB" class="B" column="TargetB_id" unique="true"/>
This association works perfectly, but problems arise when I try to make the association bidirectional. The subclass mapping looks like this:
Code:
<subclass name="B" discriminator-value="B">
<one-to-one name="owner" class="A" property-ref="TargetB"/>
</subclass>
When running the program, hibernate does not raise any exceptions and there are no log messages indicating problems with the mapping. Instead, the value of property owner in class B is always null, even if there are entities of type A that are associated to it.
Can anybody guide me to the correct direction?