I have an object that has a set attached to it containing several objects associated with it.
When I try to insert my object into the database, it fails because it tries to insert the child set with the parent ID as 0, rather than what the parent object has been inserted as.
My hibernate mapping looks like this:
<set name="Users" cascade="save-update" lazy="true" inverse ="true" > <key column ="Parent_Id"> </key> <one-to-many class ="User"></one-to-many> </set>
And I can clearly see it trying to set the parent_id as '0', shouldn't it insert the parent first, and then use the ID of the inserted value for the set??
|