The best way to replace the deprecated GenericGenerator
Introduction In this article, I’m going to show you the best way to replace the deprecated @GenericGenerator when upgrading your application to Hibernate 7.
The best way to clean up test data with Spring and Hibernate
Introduction In this article, I’m going to show you the best way to clean up test data when using Spring and Hibernate. While it’s very common to use the @DataJpaTest annotation when implementing integration tests, in this blog post, you will see why you are better off avoiding using this annotation.
How to map the Oracle TIMESTAMP WITH TIME ZONE with JPA
Introduction In this article, I’m going to explain how to map the Oracle TIMESTAMP WITH TIME ZONE with JPA and Hibernate. While the DATE and TIMESTAMP column types are suitable for mapping the LocalDateTime, the TIMESTAMP WITH TIME ZONE column type allows us to map both the ZonedDateTime and OffsetDateTime.
JTA Transaction Type
Introduction In this article, we are going to analyze how the JTA transaction type works. Since this is the default transaction type when using Jakarta EE or Java EE applications, it’s very important to understand how JTA transactions work, especially since Spring Boot or Spring applications use RESOURCE_LOCAL transactions instead.
RESOURCE_LOCAL JPA Transaction Type
Introduction In this article, we are going to analyze how the RESOURCE_LOCAL JPA transaction type works. Since this is the default transaction type when using Spring Boot or Spring Data JPA, it’s very important to understand how transactions are managed when using the RESOURCE_LOCAL mode.
Custom Spring Boot Actuator Endpoint
Introduction In this article, we are going to see how we can create a custom Spring Boot Actuator endpoint in order to export our own metrics and events. Spring Boot Actuator is a Spring Boot module that provides support for tracing and monitoring. And, while by default, we get various health checks and metrics, we are not limited to the default implementation.
How to integrate Jakarta Data with Spring and Hibernate
Introduction In this article, we are going to see how we can integrate Jakarta Data with Spring and Hibernate. Jakarta Data is a new Jakarta EE specification that provides a common API for building data Repositories and data access objects. If you are familiar with Spring Data JPA, you will see that Jakarta Data is very much inspired by this Spring API.
Hibernate SoftDelete annotation
Introduction In this article, we are going to see how we can use the Hibernate SoftDelete annotation to activate soft deleting for JPA entities. While, as I explained in this article, you can manually implement the soft delete mechanism using the @SQLDelete, @Loader and @Where annotations, it’s definitely much easier to just use the native Hibernate mechanism introduced in Hibernate 6.4 , which you can enable via the @SoftDelete annotation.

