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 Hypersistence Utils project. Another very useful feature introduced by the Hypersistence Utils 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 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.