I am working in an environment where we will need to load an object from Hibernate and pass it to a Web layer where a user can update the object. We will update the object and reassociate the object back to a new session and save the object. This works as the documentation describes.
However, we also have situations where we might have a bi-directional relationship between objects that might need to be updated. Imagine you have an interface that has checkboxes where the user can select and deselect options. Now the user deselects one of the checkboxes which relates to one of the objects in the collection (which is stored in a higher part of the object graph). When the parent object is reassociated back to the session and update is invoked on the parent, none of the removed elements from the collection are removed from the table.
I do not want to use session.delete to permanently remove the objects. I just want to break the relationship. I also understand how to do this manually with bi-directional relationships by dereferencing both ends of the relationship. Can this be done automatically with session.update/saveOrUpdate?
Thanks,
Mark[/img]
|