Vlad Mihalcea

JPA AttributeConverter – A Beginner’s Guide

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 JPA AttributeConverter works and how we can use it to customize the entity attribute to the database column mapping.

For instance, we could use a JPA AttributeConverter to map a Java MonthDay to a database DATE column because Hibernate doesn’t offer a built-in MonthDayType to handle this particular mapping.

Read More

High-Performance Java Persistence Newsletter, Issue 14

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

Introduction

Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

Read More

MySQL audit logging using triggers

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 implement an audit logging mechanism using MySQL database triggers to store the old and new row states in JSON column types.

Read More

SQL JOIN USING – A Beginner’s Guide

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 JOIN USING clause works in SQL, and how we can use it to replace the ON condition clause when the columns used to join the two tables have the same name in both the parent and the child tables.

Read More

SQL LEFT JOIN – A Beginner’s Guide

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 LEFT JOIN works in SQL, and how we can use it to associate rows belonging to different tables and build compound result sets.

Unlike JOIN or INNER JOIN, LEFT JOIN is an OUTER JOIN. So, LEFT JOIN and LEFT OUTER JOIN are equivalent. Other OUTER JOIN types are RIGHT OUTER JOIN and FULL OUTER JOIN. However, since the SQL OUTER keyword is superfluous, it’s usually omitted.

Read More

How does orphanRemoval work 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 how the JPA and Hibernate orphanRemoval mechanism allows us to trigger an entity child remove operation upon disassociating the child entity reference from the child collection on the parent side.

Read More

High-Performance Java Persistence Newsletter, Issue 13

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

Introduction

Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

Read More

Flyway Database Schema Migrations

Introduction

In this article, I’m going to explain how Flyway works and how you can use it to run automated database schema migrations using incremental SQL migration scripts.

Flyway is an open-source project created by Axel Fontaine and later acquired by Red Gate. The database migrations can be defined either as SQL scripts or JDBC-based classes.

Read More

Java Map to JSON mapping 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 how we can store Java Map entity attributes in JSON columns when using JPA, Hibernate, and the Hibernate Types project.

While you can also persist Java Map entity attributes in PostgreSQL HStore columns, a JSON column type is a much more common option, especially since it works with other relational databases, like Oracle, SQL Server, or MySQL.

As you already have seen, the Hibernate Types project allows you to map a JSON column type to a wide variety of JPA entity attributes, like POJOs, JsonNode, collections or String Java object types:

This article shows that you can also map JSON column types to Java Map entity attributes when using JPA and Hibernate.

Read More

High-Performance Java Persistence Newsletter, Issue 12

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

Introduction

Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system from Java.

Read More