Mapping PostgreSQL Interval to Java Duration with Hibernate

Introduction In this article, we are going to see how to map the PostgreSQL interval column type to a Java Duration object using Hibernate and the hibernate-types project. Another very useful feature introduced by the hibernate-types project is that all types extending the ImmutableType can now be treated as standard org.hibernate.type.Type, therefore enabling a much better Hibernate Core API integration.

What’s new in JPA 2.2 – Java 8 Date and Time Types

Introduction Now that the JPA 2.2 Review Ballot was approved let’s start analyzing some of the new additions to the standard which have been supported by Hibernate for quite some time already. In this article, we are going to see how JPA 2.2 Date/Time works, and which types you need to use depending on your business case requirements.