Panache is a Quarkus-specific library that simplifies the development of your Hibernate-based persistence layer. Similar to Spring Data JPA, Panache handles most of the repetitive boilerplate code for you. Its implementations of the repository and the active record pattern provide methods to create, update, and remove records, perform basic queries, and define and execute your

Read More

With the T getReference(Class<T> entityClass, Object primaryKey) and the T find(Class<T> entityClass, Object primaryKey) method, JPA’s EntityManager seems to provide 2 methods that do the same. Both of them seem to get an entity by its primary key from the database. There obviously is a difference between the 2 methods. An established and well-defined API

Read More

The Quarkus project enables you to develop Kubernetes-native applications based on Java and a huge list of well-established, Java-based frameworks. Hibernate is, of course, one of these frameworks. But the project not only enables you to build native applications with incredibly fast boot times and a very small memory footprint. It also provides a bunch

Read More

By default, Hibernate loads all entity objects in read-write mode. It performs dirty checks to detect changes it needs to persist in your database for each of them. That makes entities very easy to use, but it also creates an overhead if you don’t want to change anything. You can avoid this by setting Hibernate’s

Read More

I recently got a lot of questions about JPA 3.0, and since EclipseLink and Hibernate now offer full support for it, it’s time to take a closer look at the latest update of the specification. As part of the transformation from Java EE to Jakarta EE, the Java Persistence API (JPA) was renamed to Jakarta

Read More

Hibernate’s Query Plan Cache speeds up the preparation of your queries. That reduces their overall execution time, and improves the performance of your application. In the test scenario of this article, it improved the performance of the query preparation by up to 500%. To make it even better, Hibernate does all of that automatically. The

Read More

Hibernate generates proxies to provide lazy loading for to-one associations, and you can use them to improve the performance of some of your write operations. You might have seen the class names of these proxies in your debugger or some log messages. They consist of the name of your entity class and a postfix that

Read More

Hibernate provides 2 proprietary features that enable you to define additional filter criteria that Hibernate applies to every query that selects a specific entity class. This article will show you how to use the @FilterDef and @Filter annotations, which is the more flexible approach. You can activate and deactivate filter definitions for your current session

Read More