How to customize the JSON Serializer used by Hibernate-Types

Introduction

As already explained, the hibernate-types open-source project allows you to map JSON, ARRAY, PostgreSQL ENUM types and provides a simple way of adding immutable Hibernate Types.

After adding support for customizing the Jackson ObjectMapper, the next most-wanted issue was to provide a way to customize the JSON serializing mechanism.

In this article, you are going to see how you can customize the JSON serializer using hibernate-types.

Continue reading “How to customize the JSON Serializer used by Hibernate-Types”

How to customize an entity association JOIN ON clause with Hibernate @JoinFormula

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.

Continue reading “How to customize an entity association JOIN ON clause with Hibernate @JoinFormula”