Just wanted to comment that anyone else stumbling on this should not use the hacked interceptor I have in this sample project, in production code. It has a different problem in that field object changes (i.e. not within the @ElementCollection) in the owning entity are not picked up. That's because the org.hibernate.event.internal.DefaultFlushEntityEventListener.dirtyCheck(FlushEntityEvent) is using a CustomEntityDirtinessStrategy implementation to handle the case where findDirty returns null (which it wouldn't, with this hack). Because the hacked interceptor findDirty method does not find dirty indeces in other fields, it won't pick those up. It's starting to look like the workaround for me should be to use a CustomEntityDirtinessStrategy implementation somehow, but I still need to research that more.
|