You need to add auditing features to track changes in entity data. What Hibernate feature would you use to achieve this?

Hibernate Envers is the standard Hibernate module for auditing entity changes. It automatically tracks every insert, update, and delete made to annotated entities and stores each change as a numbered revision in a separate history table.

Key Points

Example

On a Order entity annotated with @Audited, every time a price or status field is updated and the transaction commits, Envers writes a new row to order_AUDIT capturing the field values and the revision that produced them, so you can later answer "what did this order look like last Tuesday."

Interview Tip

A concise interview answer is

For entity auditing I'd use Hibernate Envers — annotating entities with @Audited makes Hibernate automatically persist every revision to a shadow audit table, so I get full change history without writing manual logging code, and I can query past states through the AuditReader API.

Last updated: 16 July 2026

Previous question: During a transaction, an error occurs after several database operations have been successfully executed. How does Hibernate ensure data integrity in this situation?

Next question: You are working with a legacy database where the table and column names do not follow your standard naming conventions. How can you map these tables without modifying the existing database schema?

More Hibernate (Optional) interview questions

All Hibernate (Optional) questions