My environment is WebWork 2.1.7 + hibernate 3.0.2
A page will show the parent properties and its childs, user also can delete/add child(s), when use clicking the 'Save' button, in WW action, I will get a new childs Set including some old childs and some new childs,
so if I want update the Parent and Childs, how to do it?
In the mapping file, I have set the @hibernate.set lazy="true" inverse="true" cascade="all-delete-orphan".
In the following way, I got a error message: Don't dereference a collection with cascade="all-delete-orphan":
Parent parent = session.get(Parent.class, parentID);
parent.setChild(newChildSet);
parent.saveOrUpdate(parent);
So, could anyone contribute a simple solution?[/code]
|