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.
How to use different Java versions for main and test in Maven
Introduction In this article, we are going to see how we can use different Java versions for the main and test folders in Maven so that you can run tests on a newer version of Java.
Testcontainers Database Integration Testing
Introduction In this article, we are going to see how we can use Testcontainers for database integration testing. If you are still using HSQLDB or H2 to test your Spring Boot application that runs on Oracle, SQL Server, PostgreSQL or MySQL in production, then you are better off switching to Testcontainers.
MySQL rewriteBatchedStatements configuration property
Introduction In this article, we are going to see how MySQL rewriteBatchedStatements works when using JDBC, JPA, or Hibernate. I first researched this MySQL configuration property when I was writing the batching chapter of my High-Performance Java Persistence book, and, back then, I discovered that this setting allows batching plain Statement by rewriting the SQL string that is sent to the database. However, the MySQL 6 Connector/J documentation mentioned that: for prepared statements, server-side prepared statements can not currently take advantage of this rewrite option So, for a long time, I wrongly… Read More