Using the new Java8 date / time classes with Hibernate

At the time of writing – January 2015 – neither JPA2.1 nor the actual Hibernate implementation 4.3.8.FINAL support the use of the new Java8 date and time classes as properties for an entity class. But JPA2.1 has a @Converter annotation that together with the AttributeConverter interface enables a simple solution to the problem. (Update July 10, 2015): Hibernate 5.0.0 – currently RC2 – supports the new types without any further need for Converters; hibernate-java8 is needed on the classpath.