Hi All,
I am developing a fucntionality where in I need to get the fields which have changed in the current transaction. I use the following steps:
1. On @PreUpdate, I fetch the previous state of the object from the database (using findById()). 2. Compare the fetched object with the one I already have from the transaction 3. Print the columns which are different.
But the object fetched in step 1 is same as the one I have in my session. So all the fields are the same always. I woulkd like to know if there is a way to exclusivly fetch data from the database again irrespective of the session data.
Also, is there are better way to find the fields which have changed in the current transaction ?
Thanks for the help, Midhun
|