Hi all,
First of all, sorry fo the long subject, but it's the best way I could describe my question.
I'm using Hibernate 2.1.
I have a one-to-many relationship between tables A and B modelled in Oracle 9i such that each B record contains a field a_id, identifying the A record that the B record is associated with.
The corresponding Java object model consists of classes A and B, where A has a java.util.Collection member to contain B instances, and each B object has a member called aId, corresponding to th a_id attribute of the B table.
I've created the appropriate hbm.xml files, and I have had no problems using hibernate to insert, update or search for these objects. When I insert an A object that contains a Collection of B objects, the a_id column in the B table correctly references a record in the A table, but the aId members of the B objects in the Collection are not updated to with the id of their parent.
Should I expect the child foreign key members to be updated? If so, then I'd appreciate any thoughts regarding why they aren't getting updated now. This is the definition of the B collecition in A.hbm.xml
<set name="bSet" table="B" cascade="all">
<key column="a_id"/>
<one-to-many class="A"/>
</set>
Thanks in advance for your help,
_________________ Mike Davison
|