Vlad Mihalcea

How to use PostgreSQL pgvector with JPA, Hibernate, and Spring AI

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

In this article, I’m going to show you how to map the PostgreSQL vector column type from pgvector to a JPA entity attribute using Hypersistence Utils, and how to use it with Spring AI and Ollama to implement semantic search, recommendations, and Retrieval-Augmented Generation (RAG).

Starting with version 3.16.0, the Hypersistence Utils project provides the PostgreSQLVectorType.

Read More

A beginner’s guide to the Jenesis build tool

Introduction

In this article, I’m going to show you how we can build the Hypersistence Utils project with Jenesis, a new Java build tool created by Rafael Winterhalter, who’s a Java Champion, author of Byte Buddy and a major contributor to Mockito.

If you haven’t heard of it yet, check out this introductory article first.

Read More

Awesome conference – Game of Codes – Niš – 2026

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

Between the 9th and the 10th of October, I had the privilege of participating to the second edition of the Game of Codes conference in Niš, Serbia.

Since I couldn’t attend the first edition, I decided to participate, and I’m glad I did that. First of all, having Venkat Subramanian and Laurentiu Spilca to the first edition without being affiliated to a major conference event organizer, such as Devoxx, is very intriguing.

Read More

Thirteen years of blogging

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!

Thirteen years later!

Thirteen years ago today, I created this blog on WordPress.com because I wanted to share some best practices I discovered while developing various web and enterprise applications with both Java and .NET.

Prior to LLMs and AI tools, developers relied on Google and StackOverflow to find answer to their problems, and both blogging and answering StackOverflow questions were a very way to build your personal brand.

Nowadays, fewer and fewer developers get to read blog posts, yet it’s still useful to share your findings, even if your audience will be greatly reduced.

Read More

What I learned at DevTalks Cluj-Napoca 2026

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

On the 24th of September, I participated in the 9th edition of DevTalks Cluj-Napoca, and since I had a really great time attending this conference, I decided to share what I learned from attending sessions and having conversations with both speakers and participants.

Read More

Meet Jos Roseboom

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!

JavaZone 2026

At the beginning of September, I participated in JavaZone for the third time and had the privilege of meeting a lot of passionate software developers willing to share their knowledge with the community.

In the first conference day, I attended a very good talk about JPA performance tuning that was delivered by Jos Roseboom and since I enjoyed his talk, I proposed him to gave an interview for this blog.

Therefore, in this article we have the pleasure of getting to know Jos and take opportunity of learning about Spring and JPA and performance tuning in real-world applications.

Read More

How to emulate LEFT JOIN FETCH using Record-based projections

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

In this article, I’m going to show you how to emulate a LEFT JOIN FETCH between two root entities without fetching the intermediate child entity.

I got the inspiration for this article by this comment thread on my blog.
Read More

The best way to replace the deprecated GenericGenerator

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

In this article, I’m going to show you the best way to replace the deprecated @GenericGenerator when upgrading your application to Hibernate 7.

Read More

Book Review – Just Use Postgres!

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

My friend, Denis Magda, wrote a wonderful book called Just Use Postgres!, and I’m glad that I got the chance to read it.

Just Use Postgres!

Read More

The best way to clean up test data with Spring and Hibernate

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

In this article, I’m going to show you the best way to clean up test data when using Spring and Hibernate.

While it’s very common to use the @DataJpaTest annotation when implementing integration tests, in this blog post, you will see why you are better off avoiding using this annotation.

Read More

Black Friday 50% off the High-Performance Java, Spring, and SQL course bundle: 24 hours of video lessons Ends in Get the Bundle

Black Friday

Seize the deal! 50% off my video courses

This offer expires in:
Java Persistence Video Course Save 50% Buy Now SQL Video Course Save 50% Buy Now Spring Persistence Video Course Save 50% Buy Now

The BLACKFRIDAY26 coupon is applied automatically at checkout.