Jsondb / jsondb-core

JsonDB a pure java database that stores its data as Json Files

Home Page:http://www.jsondb.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LocalDateTime cannot be persisted

ruromero opened this issue · comments

Hi,

Is there any way to persist java.time.LocalDateTime?
I understand that the problem lays in the lack of a default constructor during the deepCopy phase.

java.lang.InstantiationException: java.time.LocalDateTime
Continuing ...
java.lang.RuntimeException: failed to evaluate: <unbound>=Class.new();

Thanks

Maybe i need to support AttributeConverter like functionality as described here for JPA: https://www.thoughts-on-java.org/persist-localdate-localdatetime-jpa/

I wish i had to time to implement this, If someone can implement this i will be glad to review and include it

Hi,

Could this issue be solved with jackson-modules-java8?

ObjectMapper mapper = new ObjectMapper()
   .registerModule(new ParameterNamesModule())
   .registerModule(new Jdk8Module())
   .registerModule(new JavaTimeModule()); // new module, NOT JSR310Module