From: Gustavo Martin Morcuende Date: Tue, 26 Jul 2016 20:24:47 +0000 (+0200) Subject: Spring JPA: MyCustomRevision, serializing revision date field. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=5f691d15ffd0acc60d260a4dc58b26620f2f911c;p=JavaForFun Spring JPA: MyCustomRevision, serializing revision date field. --- 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")