I'm having a similar problem.
Im having a model with items/packages/boxes
Now I'm going to add a newly created package to a box.
the source is something like
Code:
Box box = BoxDAO,findById(id);
Package package = new package();
session.save(package);
box.addPackage(package);
(
Where in Code:
addPackage
I handle the bidirectional relation (List of packages in Box Object, Box reference in Package Objects).)
I guess the problem results in the sequence of actions.
Hibernate wants to update the records of parent and child to accomodate for the object references, but at this point there is no child, thus resulting in a exception.
BUT: I havn't solved it myself yet...
So any hints welcome!