Closed pjgg closed 5 months ago
You need to give Postgres a hint that the value is submitted as a string. For this, you can change the SQL to:
"INSERT INTO revokedkeys (keyhash, valid_until) VALUES (#{keyhash}, to_timestamp(#{valid_until}, 'YYYY-MM-DDTHH:MI:SS.US')::TIMESTAMP WITHOUT TIME ZONE)"
Do not merge, it is just a reproducer.
Based on the documentation If I need to work with Java
LocalDateTime
the only thing that I should configure is the ObjectMapper (by adding this "JavaTimeModule" module). However, I am reaching the following error:This is because the
java.time.LocalDateTime
is mapped as an Array as is Documented on the source. If I change the ObjectMapper config to:mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
then the error is the following one:
That looks like slightly better but is not good enough.
Please find a reproducer on the following "PR".
My question is, do you think this is an issue, or there is a way to config the object mapper and make it work?