title: Persist java.time.Instant (JDK8) with JPA2/Hibernate
body: <p>Neither JPA nor Hibernate currently support the new date/time classes brought by JSR-310 in JDK8 (JPA <a href="https://java.net/jira/browse/JPA_SPEC-63">ticket</a>, Hibernate <a href="https://hibernate.atlassian.net/browse/HHH-8844">ticket</a>). Nonetheless, I'd like to code with the JDK8 date/time classes as they are finally well designed. In particular, I'm interested in <code>java.time.Instant</code>, not in full support for all <code>java.time.*</code> types, as all my entities will use this particular class (or so I think now, at least :-)</p>
  
  <p>One option is to write a <a href="http://www.thoughts-on-java.org/2013/10/jpa-21-how-to-implement-type-converter.html">type converter</a>, as defined by JPA 2.1. However, our app server is JBoss EAP 6.3 which is JPA 2.0 but not 2.1 compatible, so this is out of the question for now.</p>
  
  <p>The next option is to use a Hibernate user type (a blog post about converting other JSR-310 classes <a href="http://blog.progs.be/550/java-time-hibernate">here</a>).</p>
  
  <p>Are there better options? Thanks.</p>