Above in Person.hmb.xml I have ....
Code:
<set name="children" inverse="true" cascade="all">
<key column="parent_id"/>
<one-to-many class="Child"/>
</set>
Now according to the documentation from the Parent Child Relationships chapter....
Code:
8.3. Cascades
The explicit call to save() is still annoying. We will address this by using cascades.
<set name="children" inverse="true" cascade="all">
<key column="parent_id"/>
<one-to-many class="Child"/>
</set>
This simplifies the code above to
Parent p = (Parent) session.load(Parent.class, pid);
Child c = new Child();
p.addChild(c);
session.flush();
I read this to mean that I should not need to explicitly call save() on either the parent or the child. Am I reading this documentation wrong? Perhaps I have the cascade in the wrong place? Thanks again for the help.
Bryan