jpa-javatime

Converters to use java.time classes with JPA

License

License

GroupId

GroupId

br.com.otavio
ArtifactId

ArtifactId

jpa-javatime
Last Version

Last Version

0.2
Release Date

Release Date

Type

Type

jar
Description

Description

jpa-javatime
Converters to use java.time classes with JPA
Project URL

Project URL

https://github.com/garcia-jj/jpa-javatime
Source Code Management

Source Code Management

http://github.com/garcia-jj/jpa-javatime

Download jpa-javatime

How to add to project

<!-- https://jarcasting.com/artifacts/br.com.otavio/jpa-javatime/ -->
<dependency>
    <groupId>br.com.otavio</groupId>
    <artifactId>jpa-javatime</artifactId>
    <version>0.2</version>
</dependency>
// https://jarcasting.com/artifacts/br.com.otavio/jpa-javatime/
implementation 'br.com.otavio:jpa-javatime:0.2'
// https://jarcasting.com/artifacts/br.com.otavio/jpa-javatime/
implementation ("br.com.otavio:jpa-javatime:0.2")
'br.com.otavio:jpa-javatime:jar:0.2'
<dependency org="br.com.otavio" name="jpa-javatime" rev="0.2">
  <artifact name="jpa-javatime" type="jar" />
</dependency>
@Grapes(
@Grab(group='br.com.otavio', module='jpa-javatime', version='0.2')
)
libraryDependencies += "br.com.otavio" % "jpa-javatime" % "0.2"
[br.com.otavio/jpa-javatime "0.2"]

Dependencies

provided (1)

Group / Artifact Type Version
org.hibernate.javax.persistence : hibernate-jpa-2.1-api jar 1.0.0.Final

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

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>

Versions

Version
0.2