Vlad Mihalcea

How to map a PostgreSQL HStore entity property with JPA and Hibernate

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

Introduction

The open-source hibernate-types project allows you to map a great variety of database types that are not supported natively by Hibernate ORM (e.g. JSON, ARRAY, YearMonth, Month, INET addresses).

In this article, we are going to see how you can map a PostgreSQL HStore type, which allows you to store key/value pairs, to a Java Map entity property when using JPA and Hibernate.

Read More

How to map a PostgreSQL Enum ARRAY to a JPA entity property using Hibernate

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

Introduction

The open-source hibernate-types project allows you to map JSON, ARRAY, YearMonth, Month or database-specific columns (e.g. INET addresses).

In this article, we are going to see how you can map a PostgreSQL Enum ARRAY type to a Java array entity property when using JPA and Hibernate.

Read More

How to bind custom Hibernate parameter types to JPA queries

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

Introduction

In this article, we are going to see how we can bind a custom Hibernate parameter type to a JPA query.

I decided to write this article after one of my hibernate-types framework users created this very interesting issue on GitHub.

Read More

How to intercept entity changes with Hibernate event listeners

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

Introduction

In this article, we are going to see how the Hibernate event listeners work and how you add your custom listeners to intercept entity changes and replicate them to other database tables.

Recently, one of my blog readers asked a very good question on StackOverflow.

Since my main goal as a Hibernate Developer Advocate is to help Java developers get the most out of JPA and Hibernate, I decided that this is a good opportunity to talk about the Hibernate event listener mechanism.

Read More

The best way to initialize LAZY entity and collection proxies with JPA and Hibernate

Imagine having a tool that can automatically detect if you are using JPA and Hibernate properly. Hypersistence Optimizer is that tool!

Introduction

In this article, we are going to see the best way to initialize LAZY proxies and collections when using JPA and Hibernate.

I decided to write this article because there are way too many resources available on the Internet that mislead the reader into using awkward and inefficient practices.

Read More

Hypersistence Optimizer can automatically detect if you are using JPA and Hibernate properly