posted 13 years ago
Hello all,
I have two tables, entity and entity_historical_data. I want to maintain the historical data of each entity that was updated. So, if an entity is updated 5 times, I will have five records in the entity_historical_data for the corresponding entity ID. Also, the columns in the entity and entity_historical_data are more or less the same.
I am using Hibernate for the application and my current implementation involves manually inserting in the entity_historical_data table using hibernate before an entity with a given id is updated.
I'd like to do this using triggers, such that before update, existing record (row) which is gonna updated (old) will be added in the entity_historical_data table and then the update will be performed.
So, I will need all the data of the row which is going to be updated and will insert that data into another table using trigger.
Can someone help me with this ?