How to map table rows to columns using SQL PIVOT or CASE expressions
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
While reading the wonderful SQL Antipatterns book by Bill Karwin, which is a great reference for any developer that needs to interact with a Relational Database System, I found an example where the SQL PIVOT clause would work like a charm.
In this post, I’m going to explain how to transpose a ResultSet using PIVOT so that rows become columns.
Book Review – Designing Data-Intensive Applications
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
Exactly one year ago, I bought Designing Data-Intensive Applications by Martin Kleppmann. However, since I was busy writing High-Performance Java Persistence, it took me over a year to find the time to read Martin Kleppmann’s book.
This post is a review of what this book is all about and why you should be interested in reading it.
Audience
If you are a backend developer, a team leader or a software architect, this book must be on your reading list. While a junior developer might find the book interesting too, you got to have some background knowledge so that everything falls into place.
Content
The book is a very detailed summary of how database systems work. From relational databases to data warehouses, key-value stores, column-oriented databases, Martin Kleppman describes a lot of aspects like:
- storage engines and indexing
- data encoding
- data partitioning
- replication techniques
- transactions and concurrency control
- distributed systems and consensus algorithms
- batch processing
- streaming
Why you should buy it?
Although some concepts are not very easy to understand, Martin Kleppman does a very good job explaining all these concepts using down-to-earth examples.
The book is a summary of hundreds of research papers, books, and other scientific articles that would require you a great deal of effort to go through all of them, albeit to understand them. Hopefully, you don’t have to since the book is exactly what you need to get a better understanding of how data management systems.
Conclusion
I strongly recommend you buy this book. Although I read it, I’m sure that I’ll come back to it in future to validate that I haven’t forgotten anything I learned from this book.

The performance penalty of Class.forName when parsing JPQL and Criteria queries
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
While reviewing this Hibernate Pull Request, I stumbled on the HHH-10746 Jira issue. After doing some research, I realized that this issue was reported multiple times in the past 10 years:
In this post, I’m going to explain why this issue was causing performance issues, and how it got fixed.
How to customize an entity association JOIN ON clause with Hibernate @JoinFormula
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
As I explained in this previous article, you can map calculated properties using Hibernate @Formula, and the value is generated at query time.
In this post, you’ll see how you can use a custom SQL fragment to customize the JOIN relationship between two entities, or an entity and a collection of embeddable types.
One year as a Developer Advocate
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
Exactly one year ago today, I started working as a Developer Advocate for the Hibernate team at Red Hat. Prior to joining Red Hat, I used to work as a software architect, and I didn’t have any clue what I would have to do as a Developer Advocate. So, I learned on the way.
This post is a summary of what this role is about, and what I’ve managed to accomplish.
How to map calculated properties with Hibernate @Generated annotation
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
As I explained in this previous article, you can map calculated properties using Hibernate @Formula, and the value is generated at query time.
In this post, you’ll see how you can calculate an entity property at INSERT or UPDATE time.
How does MySQL result set streaming perform vs fetching the whole JDBC ResultSet at once
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
I read a very interesting article by Krešimir Nesek regarding MySQL result set streaming when it comes to reducing memory usage.
Mark Paluch, from Spring Data, asked if we could turn the MySQL result set streaming by default whenever we are using Query#stream or Query#scroll.
That being said, the HHH-11260 issue was created, and I started working on it. During Peer Review, Steve Ebersole (Hibernate ORM team leader) and Sanne Grinovero (Hibernate Search Team Leader) expressed their concerns regarding making such a change.
First of all, the MySQL result set streaming has the following caveats:
- the
ResultSetmust be traversed fully before issuing any other SQL statement - the statement is not closed if there are still records to be read in the associated
ResultSet - the locks associated with the underlying SQL statement that is being streamed are released when the transaction is ended (either commit or rollback).
How does MySQL result set streaming perform vs fetching the whole JDBC ResultSet at once @vlad_mihalceahttps://t.co/GhQ0ucJSjx pic.twitter.com/5ptqdyuPmG
— Java (@java) July 24, 2019
How to map calculated properties with JPA and Hibernate @Formula annotation
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
As I explained in this StackOverflow question, mapping calculated properties is very easy with JPA and Hibernate.
In this post, I’m going to demonstrate how you can derive some entity property based on one or multiple persistent entity attributes.
The print version of High-Performance Java Persistence
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
One year after I published the first part of the High-Performance Java Persistence, I managed to publish the print version of the book.
The book is printed on demand using Amazon CreateSpace, and it looks like as follows.
A beginner’s guide to SQL injection and how you should prevent it
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
Introduction
One of my readers asked me to answer the following StackOverflow question. Right from the start, I noticed that the entity query was constructed by concatenating strings, which can expose your application to SQL Injection attacks.
Unfortunately, I’ve been seeing this problem over and over throughout my career, and not all developers are aware of the serious risk associated with SQL Injection. For this reason, this post is going to demonstrate what damage can SQL Injection do to your system.




