Hi,
This thing is beginning to get on my nerves. I'm using Hibernate 2.1.4 and all I'd like to do is to detect when a persistent object has been modified (I don't even need the exact changes). Seems like a straightforward thing, using Interceptor's onFlushDirty method, but it has a drawback that it's not called when changes are made to a Collection "attribute" only, like adding a new object to a one-to-many association.
Now, I've been browsing the forum for hours, encountered this problem in at least ten different places, still I couldn't find a pattern how to get over it. The only workaround I could come up with is to retreive the dirty flag of a collection snapshot, but that's obviously not the way it's meant to be done.
This problem seems so common for me that I still feel like I'm missing something obvious here. So please, anyone, could you show me an example (or a topic that deals with this)?
Thanks,
Matyas
|