Hello, what is the recommended orm library for kotlin spring boot? JPA, JOOQ, or something else?
g
Goetz Markgraf
08/22/2023, 10:48 AM
If it has to be an ORM (Object Relational Mapper), than JPA/Hibernate is a good choice. It is very well integrated into Spring Boot.
Unfortunately, it requires mutable data structures and is therefore conceptually not fit for otherwise immutable kotlin code.
An alternative is exposed, an SQL framework to write type safe database queries. Exposed has no assumptions about the data structures you are working with, so writing functional, immutable code is made much easier.
There even is an #exposed channel on this slack
❤️ 1
j
JasonB
08/22/2023, 5:36 PM
jOOQ works great with Kotlin, especially if you don't need complicated ORM stuff
c
Cies
08/23/2023, 11:42 AM
I hate ORMs (looking at you HIbernate): they make the simple stuff slightly simpler, and the hard stuff impossible. Often there is a lot to learn to use them for slightly harder than simple stuff.
We use JOOQ, and we love it. There's also Expose which is more Kotlinesque. Make sure to see this:
https://www.youtube.com/watch?v=6Ji9yKnZ3D8▾
Cies
08/23/2023, 11:48 AM
@JasonB No-one needs complicated ORM stuff, they are going heavily out of fashion for good reasons.