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…

Hibernate Tips: How to remove entities from the persistence context before doing bulk operations
|

Hibernate Tips: How to remove entities from the persistence context before doing bulk operations

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: How do you remove entities from the persistence context before performing bulk update operations with JPQL or SQL?

Hibernate Tips: How to model an association that doesn’t reference primary key columns
|

Hibernate Tips: How to model an association that doesn’t reference primary key columns

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 have to map a legacy table model with Hibernate. It contains a many-to-one association that uses a non-primary…