LazyInitializationException – What it is and the best way to fix it
|

LazyInitializationException – What it is and the best way to fix it

The LazyInitializationException is one of the most common exceptions when working with Hibernate. There are a few easy ways to fix it. But unfortunately, you can also find lots of bad advice online. The proclaimed fixes often replace the exception with a hidden problem that will cause trouble in production. Some of them introduce performance…

Hibernate Tip: How to customize the association mappings using a composite key

Hibernate Tip: How to customize the association mappings using a composite key

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 entities uses an @IdentityClass to map a composite primary key, and I need to map a…

Hibernate Tip: Many-to-Many Association with additional Attributes

Hibernate Tip: Many-to-Many Association with additional Attributes

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: I got several questions, like the following one by Carme, about the mapping of a many-to-many association that contains…