In this article, we are going to see how you can map the
java.time.Month with both JPA and Hibernate.
As explained in this article, JPA 2.2 supports
OffsetDateTime from the
java.time package. Hibernate has been supporting the Java 8 Date/Time classes since 5.0 via the
hibernate-java8 dependency, but since version 5.2, this dependency was merged with
hibernate-core so you get the
ZonedDateTime types in addition to the ones supported by JPA 2.2.
However, neither JPA nor Hibernate supports the
java.time.Year type out-of-the-box. As you will see, adding support for
java.time.Year is very easy with both standard JPA or Hibernate.
Continue reading “How to map java.time.Year and java.time.Month with JPA and Hibernate”
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”
Recently, I got a very interesting request from one of my readers. Since I’ve been providing many custom types to support JSON, ARRAY or nullable
Character types, I decided to start a new open-source project to make it easier for you to get this extra Hibernate Types.
Continue reading “The hibernate-types open-source project is born”
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”