I am looking for a lightweight library to map the results of raw queries (ResultSet) to Kotlin objects, something like Hibernate but that gives me more control over queries and requires less configuration.
Something like ORMLite is what I am looking for, but ORMLite seems to have some problems with Raw Queries and Date objects.
This is so simple that I could create my own library, but I was wondering if there is something out there that I can use
Depending on how simple you want to keep everything I would use either use plain old JDBC (quick and dirty), or something more simple than hibernate, as it was suggested jOOQ.
If you go the JDBC route, and you start abstracting it, stop. You will slowly end up writing your own “partial” ORM, that will probably end up not very good. Usually a lot of thought is put in an ORM, and it’s overkill to build something from scratch. We did this in the past, and the results were terrible.
So what is your actual scenario? Just read the values from a table and you are done, or you are working on a full fledged application that requires a carefully built persistence layer?
So I am working on a big backend project using Ktor. The project is multimodule and follows Clean Architecture and Clean code standards.
That’s why I am looking for a lightweight library to just transform my results from SQL queries to Kotlin objects (using annotations if possible).
I am considering writting my ORM that just does that, since most ORMs do too much and get in the way (I want to keep SQL queries raw if possible, the only thing the ORM could help with is updates or deletes)