Upgraded Java 8 DateTime example to use Jadira UserTypes.

Upgraded to Jadira Usertypes 3.2 to be able tu use Hibernate-specific UserType to make sure JDK 8 date/time types get converted into appropriate SQL types by the persistence provider.
This commit is contained in:
Oliver Gierke
2014-05-06 14:38:58 +02:00
parent 9f7d90ad5c
commit 410f408f47
2 changed files with 9 additions and 2 deletions

View File

@@ -18,6 +18,12 @@
<artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
<groupId>org.jadira.usertype</groupId>
<artifactId>usertype.extended</artifactId>
<version>3.2.0.GA</version>
</dependency>
</dependencies>
</project>

View File

@@ -21,6 +21,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import org.hibernate.annotations.Type;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
@@ -33,10 +34,10 @@ public class AbstractEntity {
@Id @GeneratedValue Long id;
@CreatedDate//
// @Type(type = "org.jadira.usertype.dateandtime.threetenbp.PersistentZonedDateTime")//
@Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime")//
ZonedDateTime createdDate;
@LastModifiedDate//
// @Type(type = "org.jadira.usertype.dateandtime.threetenbp.PersistentZonedDateTime")//
@Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime")//
ZonedDateTime modifiedDate;
}