Hibernate Tip: How does Hibernate’s native ID generator work

Hibernate Tip: How does Hibernate’s native ID generator work

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 post a comment below. Question: One of the readers of my article about using Hibernate with a MySQL database asked the following question: What is…

Hibernate Tips: How to Prevent the Removal of a Parent Entity with Children

Hibernate Tips: How to Prevent the Removal of a Parent Entity with Children

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 post a comment below. Question: In one of the previous Hibernate Tips, I showed how to remove child entities automatically when you remove their…

Best Practices for Many-to-Many Associations with Hibernate and JPA

Best Practices for Many-to-Many Associations with Hibernate and JPA

Many-to-Many associations are one of the most commonly used associations with JPA and Hibernate. You can find lots of examples for them in the real world, and you can map them with JPA and Hibernate as a uni- or bidirectional association in your domain model. But you probably also know that these mappings provide several…

Hibernate Tips: How to Exclude Deactivated Elements from an Association

Hibernate Tips: How to Exclude Deactivated Elements from an Association

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 post a comment below. Question: This Hibernate Tip was inspired by a question I answered on Stack Overflow. The user had to map a…