High-Performance Java Persistence Newsletter, Issue 10

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

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.

Articles

The pick of this edition is this amazing PostgreSQL internals list of resources written by Hironobu Suzuki. Although the PostgreSQL documentation is one of the best on the market, Hironobu Suzuki’s articles provide lots of details that had aren’t covered by the official manual.

A JPA entity needs to define an identifier attribute, whose value can be assigned either manually by the application or generated automatically by the JPA provider. To generate identifier values automatically, you have multiple options. You can use an IDENTITY column, o database sequence object. Since many relational database systems offer both IDENTITY columns and database sequences, it’s important to know which one works better with JPA and Hibernate. For more details about this topic, check out this article.

MUX published a very good article about using ClickHouse for analytics queries instead of the PostgreSQL extension offered by Citus.

PostgreSQL has been offering a JSON column type for a very long time, and this storage option is very useful when you need to store unstructured data coming from external systems. If you want to learn more about PostgreSQL JSON queries, check out this article.

JPA and Hibernate make it very easy to fetch graphs of entities via JPQL. However, if you want to fetch a read-only projection, you are better off using DTO projections. If the SQL projection contains a one-to-many relationship, then you can transform the tabular-based result set into a graph of DTOs using the Hibernate ResultTransformer. If you want to learn more about this topic, check out this article.

If you are moving from Oracle to PostgreSQL or the other way around, you might bump into all sorts of issues caused by database-specific features that are not supported by both of these two relational database systems. This article helps you find these differences and what alternatives you can use for some database-specific features.

Workshop recording

The online workshop I gave at J on the Beach 2020 virtual conference about The best way to fetch data with JPA and Hibernate has been recorded and is available on my Teachable store.

The online workshop was a blast. We had almost 170 participants, and I’m looking forward to doing a sequel.

Project releases

I managed to release the 2.9.10 version of the amazing Hibernate Types project. If you’re using Hibernate, you should definitely use Hibernate Types as well.

Hibernate ORM 5.4.16 has been released. For more details about this version, check out the release notes.

Spring Data Neumann has been released. One of the most important changes is the inclusion of Spring Data R2DBC (which allows you to build reactive applications using relational database systems) in the main Spring Data release train.

If you like this newsletter,

you are going to love the next episodes!

StackOverflow Answers

The following StackOverflow answers have been trending over the past two weeks:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.