springspring-bootspring-dataspring-data-jpazoneddatetime

@CreatedBy and @LastModifiedDate are no longer working with ZonedDateTime?


i have updated an old spring boot 1.5.3 project to spring boot 2.0.0. RELEASE. I have an auditing entity with two fields of type ZonedDateTime annotated with @CreatedBy and @LastModifiedDate.

In the previous versions everything was working fine. However, with the new update, upon saving the entity in the repository i get an error i.e

 createdDate=<null>
 lastModifiedDate=<null>
 ]! Supported types are [org.joda.time.DateTime, org.joda.time.LocalDateTime, java.util.Date, java.lang.Long, long]

I checked the AnnotationAuditingMetaData, and i found noting related to ZonedDateTime.

There is also this issue in https://jira.spring.io/browse/DATAJPA-1242, I believe it's related.

My question is what am i doing wrong here, does spring stopped the support or am i doing something wrong?


Solution

  • Old answer was mistaken, but I can't delete it because it is accepted. Please scroll to other answers.