From 5f691d15ffd0acc60d260a4dc58b26620f2f911c Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Tue, 26 Jul 2016 22:24:47 +0200 Subject: [PATCH] Spring JPA: MyCustomRevision, serializing revision date field. --- .../de/spring/example/persistence/domain/audit/MyCustomRevision.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SpringJava/JPA/spring-jpa-persistence/src/main/java/de/spring/example/persistence/domain/audit/MyCustomRevision.java b/SpringJava/JPA/spring-jpa-persistence/src/main/java/de/spring/example/persistence/domain/audit/MyCustomRevision.java index 3211cb8..d388d04 100644 --- a/SpringJava/JPA/spring-jpa-persistence/src/main/java/de/spring/example/persistence/domain/audit/MyCustomRevision.java +++ b/SpringJava/JPA/spring-jpa-persistence/src/main/java/de/spring/example/persistence/domain/audit/MyCustomRevision.java @@ -16,6 +16,8 @@ import org.hibernate.envers.RevisionEntity; import org.hibernate.envers.RevisionNumber; import org.hibernate.envers.RevisionTimestamp; +import com.fasterxml.jackson.annotation.JsonFormat; + @Entity @RevisionEntity(MyCustomRevisionListener.class) @Table(name="CUSTOM_REVISION", schema="mybatis_example") @@ -30,6 +32,7 @@ public class MyCustomRevision /** extends DefaultRevisionEntity **/ { @Column(name="REVISION_DATE") @Temporal(TemporalType.TIMESTAMP) @RevisionTimestamp + @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") private Date revisionDate; @Column(name="USERNAME") -- 2.1.4