Java and Database Newsletter, Issue 6

Introduction Welcome to a new issue of the Java and Database newsletter in which we share articles, announcements, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

The best way to use the JPA SqlResultSetMapping

Introduction In this article, I’m going to explain how to use the JPA SqlResultSetMapping, as well as the EntityResult, ConstructorResult, and ColumnResult options.

N+1 query problem with JPA and Hibernate

Introduction In this article, I’m going to explain what the N+1 query problem is when using JPA and Hibernate and what’s the best way to fix it. The N+1 query problem is not specific to JPA and Hibernate, as you can face this issue even if you are using other data access technologies.

Java and Database Newsletter, Issue 5

Introduction Welcome to a new issue of the Java and Database newsletter in which we share articles, announcements, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

Java and Database Newsletter, Issue 4

Introduction Welcome to a new issue of the Java and Database newsletter in which we share articles, announcements, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

Hibernate slow query log

Introduction In this article, I’m going to show you how you can activate the slow query log when using JPA and Hibernate. This slow query log feature has been available since Hibernate ORM 5.4.5 and notifies you when the execution time of a given JPQL, Criteria API or native SQL query exceeds a certain threshold value you have previously configured.

Hypersistence Optimizer Runtime Scanner

Introduction The 2.0 version of the Hypersistence Optimizer has just arrived, and it comes with a runtime scanner that is capable of analyzing your JPA and Hibernate data access operations and queries and give you tips about how you can speed up your application. Along with the JPA and Hibernate mapping and configuration scanners, the runtime scanner makes Hypersistence Optimizer an indispensable tool for building High-Performance Java Persistence applications.

Java and Database Newsletter, Issue 3

Introduction Welcome to a new issue of the Java and Database newsletter in which we share articles, announcements, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

How to map a PostgreSQL ARRAY to a Java List with JPA and Hibernate

Introduction In this article, I’m going to show you how to map PostgreSQL ARRAY column types (e.g., text, int, double, enum, date, timestamp, UUID) to Java List entity attributes with JPA and Hibernate. While the Hibernate Types project has been supporting PostgreSQL ARRAY column types since the very first version, prior to version 2.9, you could only map database ARRAY columns to Java Array entity attributes, as illustrated by this article. Mapping database ARRAY columns to java.util.List entity attributes is a much better approach than using the previous Java Array option since,… Read More

Java and Database Newsletter, Issue 2

Introduction Welcome to a new issue of the Java and Database newsletter in which we share articles, announcements, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.