Hibernate Envers : How to Implement a Conditional Audit Log

Опубликовано: 05 Октябрь 2024
на канале: Thorben Janssen
6,248
76

Today, I want to show you how to implement a conditional audit with Hibernate Envers.
Envers automatically integrates with Hibernate ORM and provides a powerful and easy to use solution to write an audit log. As I described in previous videos, you just need to add Envers to your classpath and annotate your entities with @Audited. It will then document all insert, update and delete operations and you can even perform complex queries on your audited data and customize the revision information.
Sounds quick and easy, right?
Well, it is, as long as you audit all changes performed on an entity. But implementing a conditional audit requires more work. By default, Hibernate Envers registers a set of event listeners which are triggered by Hibernate ORM. You need to replace these listeners to customize Envers’ audit capabilities.

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!
➜ http://bit.ly/2cUsid8

Join the free Member Library:
https://goo.gl/dtyIIC

Read the accompanying post: https://www.thoughts-on-java.org/cond...

Want to connect with me?
Blog: http://www.thoughts-on-java.org/
Twitter:   / thjanssen123  
Facebook:   / thoughtsonjava