I am using hibernate envers in my springboot project. So the audit table will have all historic data except data for deleted revision because in properties file we didn't set spring.jpa.properties.org.hibernate.envers.store_data_at_delete=true
Now we want to manually update all the deleted revisions data. Is it possible in hibernate envers to update the deleted revision row with some fields in audit table.
Example: I have employee table with id(int), name(string), age(int), address(string). And i have audit table created with id, name, age, address, revtype, revid. Here in my audit table new row will be added for each ADD, MOD, DEL. But for revision DEL, only id, revtype and revid is inserted with all other fields null. Is it possible to update this audit table with other fields for deleted revisions.
It is technically possible (if you are able to determine the state of the entity at deletion time) to update the rows in the audit tables that represent
DEL
revision types with each column's state.This process is pretty simple for basic entities that have no relationships to other tables; however if you have an entity that has an association or uses a middle audit entity table, care will need to be taken that you're correctly updating the references to avoid problems when reading the row from the database using the
AuditReader
.