A beginner’s guide to Spring Data Envers

Introduction In this article, we are going to investigate the Spring Data Envers project and see how to get the best out of it. Hibernate Envers is a Hibernate ORM extension that allows us to track entity changes with almost no changes required on the application part. Just like Envers plugs into Hibernate ORM in order to build an audit log for entity changes, the Spring Data Envers project plugs into Spring Data JPA to provide audit logging capabilities to JPA Repositories.

How to audit entity modifications using the JPA @EntityListeners, @Embedded, and @Embeddable annotations

Introduction In this article, we are going to see how we can use the @EntityListeners, @Embedded, and @Embeddable annotations with JPA and Hibernate to audit entity modifications. After I wrote the article about inheriting properties from a base class entity using @MappedSuperclass, I got an avalanche of opinions, but this one from Lukas deserves a blog post: While @MappedSuperclass has its benefit, allowing you to reuse even the @Id mapping, as well as being more lenient towards Hibernate-specific auto-generated properties like @GeneratedValue, using Embeddable types is the other JPA alternative for reusing… Read More