garcia-jj / jpa-javatime

A simple project with adapters to use java.time classes with JPA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jpa-javatime

Build status Coverage Status

A simple project with adapters to use java.time classes with JPA.

At this time JPA providers don't recognize java.time classes as temporal fields. So this project exists to solve this gap, adding some converters to allow us to use java.time classes in our projects.

To install you need to add this artifact in your pom.xml if you are using Maven.

<dependency>
    <groupId>br.com.otavio</groupId>
    <artifactId>jpa-javatime</artifactId>
    <version>0.2</version>
</dependency>

Or if you don't like to use Maven or any dependency manager, you can copy the jar available here to your project by your hands.

And after you need to add the converters in your persistence.xml file:

<class>br.com.otavio.jpa.javatime.PersistentLocalDate</class>
<class>br.com.otavio.jpa.javatime.PersistentLocalDateTime</class>
<class>br.com.otavio.jpa.javatime.PersistentLocalTime</class>
<class>br.com.otavio.jpa.javatime.PersistentYearMonth</class>

About

A simple project with adapters to use java.time classes with JPA.

License:Apache License 2.0


Languages

Language:Java 100.0%