Migrating to Hibernate 6

Migrating to Hibernate 6

Hibernate 6 has been released for a while, and I see more and more teams migrating their persistence layers or at least preparing for the migration. As so often, the work required for the migration to Hibernate 6 depends on your code quality and the Hibernate version you’re currently using. For most applications using Hibernate…

Create better Criteria queries with Blaze persistence

Create better Criteria queries with Blaze persistence

The Blaze Persistence project provides an interesting alternative to JPA’s Criteria API. Both APIs enable you to define queries dynamically at runtime. Most developers use it to create query statements based on user input or the result of a business operation. Unfortunately, JPA’s Criteria API isn’t very popular because it’s hard to read and write….

6 Performance Pitfalls when using Spring Data JPA

6 Performance Pitfalls when using Spring Data JPA

Thanks to its ease of use, Spring Data JPA is an incredibly popular persistence framework. If developers have something to complain about, they usually criticize object-relational mapping in general or the risk of performance problems. And while you can, of course, criticize the concept of object-relational mapping, you shouldn’t blame Spring Data JPA for your…

Database portability – Pitfalls when supporting multiple RDBMS with Hibernate

Database portability – Pitfalls when supporting multiple RDBMS with Hibernate

The JPA specification and Hibernate, as its most popular implementation, claim to provide database portability. That means you don’t need to change your persistence code or mapping annotations when connecting your application to a different RDBMS. They achieve that by providing an automated object-relational mapping, an API that abstracts from the executed SQL statements, and…

The differences between Spring Data JPA’s save, saveAndFlush and saveAll methods

The differences between Spring Data JPA’s save, saveAndFlush and saveAll methods

Spring Data JPA’s standard repositories provide a set of methods that handle common operations used by most persistence layers. That saves us a lot of time and allows us to focus on our business logic. But we also need to ask ourselves which of these methods we want to use. You need to know how…