I am using struts and hibernate. I have a parent and child relation using set in hbm.
In the action I am using session.saveOrUpdate()
method to save but while s
It looks like, cargo
can have one or more item
. Each item would have a reference to its corresponding cargo
.
From the log, item
object is inserted first and then an attempt is made to update the cargo
object (which does not exist).
I guess what you actually want is cargo
object to be created first and then the item
object to be created with the id of the cargo object as the reference - so, essentally re-look at the save() method in the Action class.