Hibernate 6 and JPQL Window Functions
Introduction In this article, I’m going to show you how you can use Hibernate 6 to write JPQL queries that use SQL Window Functions. This feature has been added in Hibernate 6, which provides a new query parser called SQM (Semantic Query Model), which is more powerful than the previous Hibernate HQL query capabilities.
Java application performance tuning using Lightrun
Introduction In this article, I’m going to show you analyze a Java application using Lightrun so that you can discover various performance tuning improvements you could apply to your current Java application. In this previous article, I explained what Lightrun is and how you can use it to inject dynamic logs, capture runtime snapshots, or add dynamic metrics. In this article, I’m going to use Lightrun as an alternative to my JPA Association Fetching Validator.
JPA Association Fetching Validator
Introduction In this article, I’m going to show you how we can build a JPA Association Fetching Validator that asserts whether JPA and Hibernate associations are fetched using joins or secondary queries. While Hibernate does not provide built-in support for checking the entity association fetching behavior programmatically, the API is very flexible and allows us to customize it so that we can achieve this non-trivial requirement.
How to write EXISTS subqueries with JPA and Hibernate
Introduction In this article, I’m going to show you how to write EXISTS subqueries with JPA and Hibernate. EXISTS subqueries are very useful as they allow you to implement SemiJoins. Unfortunately, many application developers are not aware of SemiJoins, and they end up emulating it using EquiJoins (e.g., INNER JOIN) at the cost of query performance.
The best way to handle time zones in a Java web application
Introduction In this article, I’m going to show you what is the best way to handle time zones when developing a Java web application. I applied all these best practices while developing RevoGain, a web application that allows you to calculate the gains you realized while trading stocks, commodities, or crypto using Revolut.
How to map polymorphic JSON objects with JPA and Hibernate
Introduction In this article, I’m going to show you how you can map polymorphic JSON objects when using JPA and Hibernate. Since Hibernate doesn’t support JSON natively, I’m going to use the Hypersistence Utils library to achieve this goal.
Hibernate Batch Sequence Generator
Introduction In this article, I’m going to introduce the Hibernate Batch Sequence Generator implementation that’s provided by Philippe Marschall to the Hypersistence Utils project
The JPA and Hibernate second-level cache
Introduction In this article, I’m going to explain how the JPA and Hibernate second-level cache mechanism works and why they are very important when it comes to improving the performance of your data access layer.
JPA Bulk Update and Delete with Blaze Persistence
Introduction In this article, I’m going to show you how to write JPA Bulk Update and Delete queries using the amazing Blaze Persistence framework. Blaze Persistence is a JPA framework that allows you to build Criteria queries that are much more powerful than the standard JPA Criteria API. More, it also provides support for Keyset Pagination, which is very useful when having to navigate over large result sets.
Keyset Pagination with JPA and Hibernate
Introduction In this article, I’m going to show you how you can use the SQL Keyset Pagination or Seek Method technique with JPA, Hibernate. As explained in this article, Keyset Pagination can help you navigate large result sets without having to scan the entire database index that’s required for fetching the result set in predefined sorting order.