|
We think that the below described behaviour of Hibernate is a bug. Further information about the entity relationsship, test case etc. is provided in the following Hibernate Forum post: https://forum.hibernate.org/viewtopic.php?f=1&t=1037381
Our setup: We have two entities UserBO (parent) and InternalOrganizationBO (child). Both objects have a boolean flag 'flushUpdates'. This flag is evaluated by a custom "findDirty" implementation returning an empty array when set to false.
The test case: 1. We load a UserBO object from the database 2. Create an new InternalOrganizationBO. 3. Set the flushUpdate flag for both entities to false 4. Set the InternalOrganizationBO in the UserBO object 5. Execute an entityManager.flush
The issue / bug: During the flush we observe that Hibernate inserts the InternalOrganziationBO in the database
Why we think it is a debug: We do not an explicit persist for the InternalOrganizationBO AND the flushUpdate for both object is set to false. We also see that the custom findDirty returns an empty array for both entites. Thus we would expect that NO database action is triggered.
|