Hello,
I have problems configuring some relationships. I have class SimplePrice and class RolledPrice, the second inherits the first.
The cofiguration file is like this:
Code:
<class name="SimplePrice">
<id name="id" type="long" column="simplePrice_id">
<generator class="sequence"/>
</id>
...
<joined-subclass name="RolledPrice">
<key column="simplePrice_id"/>
<one-to-one class="SimplePrice" name="contractPrice"/>
</joined-subclass>
</class>
What happens is that I have a new instance "a" of type "RolledPrice" and I assign to the "contractPrice" property a "SimplePrice" instance (that's already persisted, with the id 100 for example), after that I call "hibernateTemplate.persist(a)". Later when I retrieve the "RolledPrice" instance added before (for example now it has id 1001), it has a reference to itself in the property "contractPrice", instead of a "SimplePrice" instance with the id 100.
This happens during a JUnit test, using Spring and in-memory HSQLDB.
Could someone tell me what am I doing wrong?
Thank you,