I switched from Hibernate from 4 to 5, so it may be convenient for you that I did, removed all the Joda time dependencies, and replaced the classes with a new Java Date Api like this.
From Joda's time
@Type(type="org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime") private LocalDateTime startDate; @Type(type="org.jadira.usertype.dateandtime.joda.PersistentDateTime") private DateTime creationDate;
K Java 8 Date
@Type(type="org.hibernate.type.LocalDateTimeType") private java.time.LocalDateTime startDate; @Type(type="org.hibernate.type.ZonedDateTimeType") private java.time.ZonedDateTime creationDate;
Remove maven dependencies if you have any
<dependency> <groupId>joda-time</groupId> <artifactId>joda-time-hibernate</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.3</version> </dependency> <dependency> <groupId>org.jadira.usertype</groupId> <artifactId>usertype.core</artifactId> <version>3.1.0.CR8</version> </dependency>
And add hibernate-java8
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-java8</artifactId> <version>5.0.4.Final</version> </dependency>
You can see more details on how to convert Joda Time Type to Java Date Time http://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html
source share