From Hibernate Types to Hypersistence Utils
Introduction In this article, I explain why the Hibernate Types became Hypersistence Utils, and how you can migrate your old dependency to Hypersistence Utils 3.0.
Spring MDC Transaction Logging
Introduction In this article, we are going to see how to configure a Spring application to use MDC (Mapped Diagnostic Context) for transaction logging. This technique is going to help us inject the Persistence Context information as well as the associated database transaction identifier in all the log entries emitted from within a @Transactional service method.
Spring Data Hibernate Entity Listeners
Introduction In this article, we are going to see how we can configure Spring Data to register several Hibernate Entity Listeners that can intercept entity state modifications. As I explained in this article, JPA also offers an event listening mechanism that you can configure via the @EntityListeners, @PostPersist or @PostUpdate, or PostRemove annotations. However, the JPA solution is way too limited as it doesn’t allow you to interfere with the EntityManager directly. Therefore, I prefer using the Hibernate Entity Listeners mechanism, which you can easily integrate with Spring Data, as this article… Read More
The best UUID type for a database Primary Key
Introduction In this article, we are going to see what UUID (Universally Unique Identifier) type works best for a database column that has a Primary Key constraint. While the standard 128-bit random UUID is a very popular choice, you’ll see that this is a terrible fit for a database Primary Key column.