Hibernate Envers Auditing (schema-mysql.sql)
Description: Auditing is useful for maintaining history records. This can later help us in tracking user activities.
Key points:
- each entity that should be audited should be annotated with
@Audited - optionally, annotate entities with
@AuditTableto rename the table used for auditing - rely on
ValidityAuditStrategyfor fast database reads, but slower writes (slower than the defaultDefaultAuditStrategy) - remove (disable)
spring.jpa.hibernate.ddl-autoor set it tovalidatefor avoiding schema generated from JPA annotations - create
schema-mysql.sqland provide the SQL statements needed by Hibernate Envers - if the schema is not automatically found, then point it via
spring.jpa.properties.org.hibernate.envers.default_catalogfor MySQL orspring.jpa.properties.org.hibernate.envers.default_schemafor the rest

