I want each action taken on certain tables to be logged. I want logging at column level (not all but some) so if a value has been changed for certain column I would like to log that for eg.
Price for product x has been changed by user U
(assume price & product are in the same table.)
for this I want to monitor price column of product x.
I cannot use a trigger to do this as I want the user to be logged as well, User information atm is the in the portal application (can't pass that to the trigger).
I am currently using apache cayenne and on the pre-update (in the entity class) call back I want to compare the new price (which the user has chosen in portal) to the one sitting in Database
when I try to get the product from database, cayenne does not returns me a fresh object, rather returns the same object with changed values
I was wondering if anyone is aware of some way Cayenne can return me fresh object for the same pk(id) (thats what I am using to get a fresh object from the db)
or
can advice me some other way