How to map JSON collections using JPA and Hibernate

Introduction

The open-source hibernate-types project allows you to map Java objects or Jackson JsonNode as JPA or Hibernate entity properties, and, thanks to our awesome contributors, we have added support for storing type-safe JSON collections.

In this article, you are going to see how to achieve this goal.

Continue reading “How to map JSON collections using JPA and Hibernate”

How to store schema-less EAV (Entity-Attribute-Value) data using JSON and Hibernate

Introduction

One of my Twitter followers has recently asked me about a way of storing EAV (Entity-Attribute-Value) data using JPA and Hibernate, and, because this is a very good question, I decided to turn answer it using a blog post.

In this article, you are going to see how you can use JSON types to store schema-less EAV data.

Continue reading “How to store schema-less EAV (Entity-Attribute-Value) data using JSON and Hibernate”

How to map JSON objects using generic Hibernate Types

Introduction

Since not all relational database systems support JSON types, Hibernate does not come with a built-in JSON Type mapper. Traditionally, all custom types have been supplied via a UserType implementation. However, a UserType is not very developer friendly so, in this post, I’m going to show how you can do a better job using AbstractSingleColumnStandardBasicType instead.

Continue reading “How to map JSON objects using generic Hibernate Types”