Consider the following scenario:
Class A {
int someField;
Set objectsOfTypeB;
}
class B {
int someOtherField;
A objectOfTypeA;
}
Now, suppose i retrieve a object of type A containing NO child objects(i.e. empty set).
Then i update the 'someField' in object A. Also, i add a new object of type B in the set 'objectsOfTypeB'. I then save the object A.
Now, suppose in the onSave() lifecycle method of object B, i issue a VETO. My question is this:
- When i issue the VETO statement, the object B will NOT be saved
- Will the object A be updated in this case? i.e. will the change that i made to 'someField' in object A, be persisted in the database, i mean will Hibernate proceed further to save object A?
Thank you.
|