Quote:
don't know at the time to save if if the the children were removed or if the children were in a Lazy state
I am not sure why you would want to know this information - especially if all of your relationships are mapped in hibernate because hibernate will take care of this for you. But you have your reasons which we do not need to get into.
Quote:
In a merge process, I don't know if Hibernate under the hood have a idea of a "dirty/already loaded collection",
Yes.
Quote:
But over the hood I don't see any way to get this data
Again, not sure why you care.
If you want to know if something has children, and how many children, but the underlying collection is lazy loaded, you could introduce a "formula" to the mapping that simply does a sql count of all the available children. Map that to a Long and then in your logic check to see if the collection contains that number or not.
Quote:
is that when I remove all children of a deal (like the Recipiants list) I don't know at the time to save if if the the children were removed or if the children were in a Lazy state.
Why do you care at the time of save? Hibernate handles all of this for you. If your problem is because some other process has the same instance and you are concerned that the data it has is stale, then you will need to introduce versioning on your child objects.