-
Notifications
You must be signed in to change notification settings - Fork 1.5k
AuditAware not converting to ZonedDateTime anymore [DATAJPA-1242] #1579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Jens Schauder commented There is already a little collection of issues asking for such a conversion |
Jens Schauder commented Types with Zone information are very problematic. Especially in the context of Auditing. What timezone should get used? The one of the server where Spring is actually running? Of the user client (which is completely unknown to Spring Data). Auditing should just record a point in time, which does not include a time zone. So that it ever worked could be considered a bug. |
Hetmoteus commented What about LocalDateTime which is used as replacement for Gregorian Calendar in the new version ? LocalDateTime is not an Instant and therefor we won't have UTC time in database am I right ? |
Jens Schauder commented Yes, by default the But the And that can provide |
Hetmoteus commented Ok, but the current implementation is not recording "a point in time" when it is using LocalDateTime. |
Jens Schauder commented After spending some time with this I agree. Created DATACMNS-1243 to handle that |
Jens Schauder commented Batch closing resolved issue without a fix version and a resolution indicating that there is nothing to release (Won't fix, Invalid ...) |
Hetmoteus opened DATAJPA-1242 and commented
I am using spring-boot 1.5.x with
@EnableJpaAuditing
My entity has the following attribute :
@CreatedDate
protected ZonedDateTime createdAt;
It was working fine in spring-data 1.12.6.RELEASE converting from Calendar to ZonedDateTime.
Then I tried to switch to spring-boot 2 M7 which is using spring-data 2.0.2 and now I got the following error :
java.lang.IllegalArgumentException: Invalid date type for member ...
Seems like there is no converter between LocalDateTime and ZonedDateTime available.
Found a similar issue on spring-boot github:
spring-projects/spring-boot#10743
Affects: 2.0.2 (Kay SR2)
Reference URL: spring-projects/spring-boot#10743
Issue Links:
DATACMNS-639 Jsr310 support should include TimeZoned types
DATACMNS-834 Jsr310Converters does not support ZonedDateTime
DATACMNS-698 Add converter for OffsetDateTime and OffsetTime to JSR310 Converters
DATAREST-1355 LastModified header calculation does not support ZonedDateTime properties
DATACMNS-1243 Add converters Instant <-> LocalDateTime
The text was updated successfully, but these errors were encountered: