Hi,
I am using hibernate-enverse for auditing purpose. In my requirement, i need to fetch the current object and the previous version of it and compare it. For comparison purpose, i am converting the object into json and working on it. In order to get the previous revision of the object, i am fetching the previous version of the object from AuditReader and merging it with the entityManager. Then fetching the object again.
This is ok for having lesser number of objects but i have got a hierarchy of objects nested to this main object.
In order to fulfill this requirement, i am fetching all the changes for the particular version and merging it in the entityManager and then fetching at the highest level using the key of the top-level object.
This is really a dirty way for doing such things.
Is there any other way possible which enables us to get the previous versions of the objects without merging all the changes.
Any lead will be helpful.
Thanking in advance, Keshavendra P S
|