Skip to content

Please add support for Java8 java.time.LocalDate #282

@mvysny

Description

@mvysny

Thank you for your wonderful library, I'm integrating it into my framework (Vaadin on Kotlin) and it works flawlessly. One thing though: if I have a pojo with java.time.LocalDate, it seems that it cannot be mapped since reading such pojo from a database will result in

at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
	at org.sql2o.reflection.MethodAccessorsGenerator$2.setProperty(MethodAccessorsGenerator.java:126)
	at org.sql2o.DefaultResultSetHandlerFactory$4.handle(DefaultResultSetHandlerFactory.java:180)
	at org.sql2o.PojoResultSetIterator.readNext(PojoResultSetIterator.java:34)
	at org.sql2o.ResultSetIteratorBase.safeReadNext(ResultSetIteratorBase.java:87)
	at org.sql2o.ResultSetIteratorBase.hasNext(ResultSetIteratorBase.java:52)
	at org.sql2o.Query.executeAndFetch(Query.java:455)
	at org.sql2o.Query.executeAndFetch(Query.java:441)

It seems that the type is correctly of type LocalDate, however actual value is java.sql.Date. I'm using H2, the database column type is DATE. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions