Hi all,
I am working with a entity graph. My A entity class contains sets of B which contains sets of C.
Mapping : All of this is mapped birectionnally (<set ...> in the parent with cascade="all,delete-orphan", <many-to-one ...> in each child).
I modified a property of B. So I call
Code:
Session.update(myInstance);
to update the B class.
The thing is : I'm working one copies of entities. So there's no way to detect the changes (i.e. I'm not working with proxified objects) that have been done.
I know that the method I'm coding will actually only affect fields of B class, none of the parent one (A) or one of the children (in the C set).
So in this method, I'd like to be able to disable the cascade mode and set it for this time to cascade="none" to be sure that the update will only affect the B table.
In fact, without doing it, because my object is a copy of the old retrieved B entity, when I update the B object, an update is called for each of the C element 'cause H3 can't know it has changed or not and the cascade mode is "all,delete-orphan"...
To sum up : is there a method to temporarily disable cascading ? Like the setFetchMode() method can change the default lazy behaviour given in the hbm files ?
Thanks a lot.
Hibernate version: 3.1.1