sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters.
I recently upgraded to v1.8.0 from v1.6.0 and noticed that the code that used kotlin data class as pojo stopped working.
This change seems to have occurred since v1.7.0.
Exception in thread "main" org.sql2o.Sql2oException: Could not find parameter-less constructor of class class org.example.User
at org.sql2o.reflection.ReflectionObjectConstructorFactory.newConstructor(ReflectionObjectConstructorFactory.java:24)
at org.sql2o.reflection.FactoryFacade.newConstructor(FactoryFacade.java:80)
at org.sql2o.reflection.PojoMetadata.initializePropertyInfo(PojoMetadata.java:99)
at org.sql2o.reflection.PojoMetadata$Cache.evaluate(PojoMetadata.java:244)
at org.sql2o.reflection.PojoMetadata$Cache.evaluate(PojoMetadata.java:241)
at org.sql2o.tools.AbstractCache.get(AbstractCache.java:49)
at org.sql2o.reflection.PojoMetadata.getPropertyInfoThroughCache(PojoMetadata.java:81)
at org.sql2o.reflection.PojoMetadata.<init>(PojoMetadata.java:68)
at org.sql2o.DefaultResultSetHandlerFactoryBuilder.newFactory(DefaultResultSetHandlerFactoryBuilder.java:61)
at org.sql2o.Query.newResultSetHandlerFactory(Query.java:539)
at org.sql2o.Query.executeAndFetch(Query.java:585)
at org.example.MainKt.main(Main.kt:32)
at org.example.MainKt.main(Main.kt)
Kotlin's data class is very useful and I want to use it as a POJO as before, is it possible to fix this behavior...?
My english is very poor, sorry.
Thank you for making great library!
I recently upgraded to v1.8.0 from v1.6.0 and noticed that the code that used kotlin data class as pojo stopped working. This change seems to have occurred since v1.7.0.
sample project
Data Class Definition
v1.6.0 outputs
but in v1.7.0
Kotlin's data class is very useful and I want to use it as a POJO as before, is it possible to fix this behavior...?