JPA

Configuring @PostLoad and @PostUpdate in JPA/Hibernate

In this post we will discuss how to use the @PostLoad and @PostUpdate annotations in Hibernate/JPA. This tutorial assumes that you have some knowledge of the @PreUpdate and @PrePersist annotations. If you are not familiar with these annotations, then please check our earlier post here. What are the @PostLoad and @PostUpdate annotations The @PostLoad and […]

How to manage JPA bidirectional relationships properly

In this troubleshooting guide, we will explore how to properly map bidirectional relationships and common mapping pitfalls that cause exceptions such as DataIntegrityViolationException, a ConstrainViolationException and a PropertyValueException. We will take an unusual approach in this guide by first building the faulty software, and then we will discuss how and why this should be fixed. […]

org.hibernate.MappingException: Could not determine type for: java.util.List – Causes & Fixes

In this post, we will explore a very common Hibernate error, namely a MappingException caused by missing annotations on the Entity getters and fields. The error Let us check the following stack trace as an example: java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path resource […]

Scroll to top