Hibernate Tips: How to Increase the Version of the Parent Entity When Updating a Child Entity
|

Hibernate Tips: How to Increase the Version of the Parent Entity When Updating a Child Entity

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: I’m using optimistic locking to avoid concurrent modifications of the same entity. But Hibernate’s versioning mechanism ignores changes on…

How to Implement Conditional Auditing with Hibernate Envers

How to Implement Conditional Auditing with Hibernate Envers

Hibernate Envers automatically integrates with Hibernate ORM and provides a powerful and easy to use solution to write an audit log. As I described in a previous post, 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…