spring-batch
spring-batch copied to clipboard
Support Java 8 Dates in Job and Step Execution [BATCH-2590]
Philippe Marschall opened BATCH-2590 and commented
Currently all timestamps on JobExecution and StepExecution are of type java.util.Date. It would be cool if instead they could be directly a Java 8 Date Time API type, OffsetDateTime and ZonedDateTime are obvious candidates.
Ideally the data type of the corresponding database would be changed from TIMESTAMP to TIMESTAMP WITH TIME ZONE as well.
No further details from BATCH-2590
Yep +1 here. And also consider changing the job parameter types to be java8 Date Time API.
@benas - When Spring Batch 5.0.0 will be ready?
@javaHelper It depends on the release date of SF 6, but it is expected for the upcoming Fall.
While evaluating the change of timestamp fields to OffsetDateTime, several issues popped up, see #4209.
For this reason, we have decided to change the type from java.util.Date to java.time.LocalDateTime for now, and defer the feature of making those fields timezone aware to a future release.
@fmbenhassine ~Hello, it seem the datatype is still Date, not LocalDateTime on the API(JobParametersBuilder.addDate). Is this issue still ongoing or removed? I can contribute if you allow me to. Thanks.~
It's off-topic, but is there any rationale to exclude addBoolean on the JobParametersBuilder?
@fmbenhassine Hello, it seem the datatype is still Date, not LocalDateTime on the API(JobParametersBuilder.addDate). Is this issue still ongoing or removed? I can contribute if you allow me to. Thanks.
It's there?
new JobParametersBuilder()
.addLocalDateTime(Config.JOB_PARAMETER_NAME_TO_DATE, LocalDateTime.now())
@davidkarlsen Sorry, I was using spring boot 2. I checked it from code.
How about addBoolean? Should I make a new issue?