The Spring Data findAll Anti-Pattern
Introduction In this article, we are going to see why inheriting the default Spring Data findAll method in every data access Repository is a terrible Anti-Pattern.
The best way to fetch a Spring Data JPA DTO Projection
Introduction In this article, I’m going to show you what is the best way to fetch a Spring Data JPA DTO Projection. Apart from the basic use cases, we’re going to see how to fetch even hierarchical DTO structures using Spring Data JPA.
The best way to map MonetaryAmount with JPA and Hibernate
Introduction In this article, we are going to see what is the best way to map the MonetaryAmount object from Java Money and the Currency API when using JPA and Hibernate. While the Java Money and Currency API define the specification, like the MonetaryAmount interface, the Moneta project provides a reference implementation for this API.
Spring Data JPA MultipleBagFetchException
Introduction In this article, I’m going to show you how to handle the MultipleBagFetchException thrown by Hibernate upon simultaneously fetching multiple collections with Spring Data JPA.
The best Spring Data JpaRepository
Introduction In this article, I’m going to show you the best way to use the Spring Data JpaRepository, which, most often, is used the wrong way. The biggest issue with the default Spring Data JpaRepository is the fact that it extends the generic CrudRepository, which is not really compatible with the JPA specification.
Java data access technology survey results
Introduction Java has tons of data access frameworks, and in this article, we are going to what Java database technology is preferred by developers and for what reasons. The number one reason why we have so many data access frameworks in Java is JDBC. JDBC was a remarkable achievement. Prior to JDBC, programming languages didn’t have a database communication abstraction that could allow one application to work with any relational database implementing the JDBC Driver specification. The fact that JDBC offered this unified abstraction allowed Java developers to create various data access… Read More

