High-Performance Java Persistence Newsletter, Issue 13

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

Java Map to JSON mapping with JPA and Hibernate

Introduction In this article, we are going to see how we can store Java Map entity attributes in JSON columns when using JPA, Hibernate, and the Hibernate Types project. While you can also persist Java Map entity attributes in PostgreSQL HStore columns, a JSON column type is a much more common option, especially since it works with other relational databases, like Oracle, SQL Server, or MySQL. As you already have seen, the Hibernate Types project allows you to map a JSON column type to a wide variety of JPA entity attributes, like… Read More

High-Performance Java Persistence Newsletter, Issue 12

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

JPA and Hibernate Query setParameter – User Guide

Introduction In this article, I’m going to show you how the JPA Query setParameter method works for basic entity attributes, and how you can use it when dealing with custom Hibernate types. If you ever stumbled on the “column is of type jsonb but expression is of type bytea” PostgreSQL issue and didn’t know how to fix it, then you should definitely read this article.

High-Performance Java Persistence Newsletter, Issue 11

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

How to get the SQL query from JPQL or JPA Criteria

Introduction In this article, I’m going to show you how you can get the auto-generated SQL query from a JPQL or JPA Criteria API entity query.

High-Performance Java Persistence Newsletter, Issue 10

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

How to generate JPA entity identifier values using a database sequence

Introduction In this article, I’m going to show you how you can generate entity identifier values using a database sequence when using JPA and Hibernate. Using a database sequence is the most efficient Hibernate identifier generation strategy, as it allows you to take advantage of the automatic JDBC batching mechanism.

How to fetch a one-to-many DTO projection with JPA and Hibernate

Introduction In this article, I’m going to show you how you can fetch a one-to-many relationship as a DTO projection when using JPA and Hibernate. While entities make it very easy to fetch additional relationships, when it comes to DTO projections, you need to use a ResultTransformer to achieve this goal.

High-Performance Java Persistence Newsletter, Issue 9

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.