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: What’s the difference between @Column(nullable = false) and @NotNull

Hibernate Tips: What’s the difference between @Column(nullable = false) and @NotNull

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 my entity attributes shall not be null. There seem to be 2 different ways to ensure that….

Hibernate Tips: How to Customize a Constructor Expression for Different Subclasses

Hibernate Tips: How to Customize a Constructor Expression for Different Subclasses

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: Last week, one of my coaching clients asked an interesting question: He used the InheritanceType.SINGLE_TABLE to map an inheritance hierarchy…