I want to write a protocol every time an objects persistent state has changed. The protocol should contain the old and the new value of every member variable of the object, even some information of collections (e.g. the unique key or a short string information of the objects in the collection).
This is easy, if a new object is stored or if a persistant object is deleted. But it's not so easy, if a persistant object is updated.
At the moment I try to write the protocol in hibernates LifeCycle Callbacks onSave, onUpdate and onDelete. But I don't see how to get the old values of the member variables there.
Does anybody have experience with this topic? Thanks for any help or idea!
|