Sorry, Does everyone use JPA with Kotlin and Sprin...
# spring
m
Sorry, Does everyone use JPA with Kotlin and Spring Boot? Or do you use a different ORM?
t
i would recommend jetbrains-exposed, #exposed https://www.jetbrains.com/exposed/
馃憤 1
plus1 1
h
I use jOOQ and I do quite like it (it's not really an ORM though). It has nice integrations with Kotlin and is officially supported by Spring Boot (
spring-boot-jooq
and
spring-boot-jooq-test
modules).
馃憤 2
plus1 3
h
Usually I go with Exposed
鉂わ笍 2
a
At work we stick with JPA, for side projects I normally go with what I think is more fun at the time (currently exposed)
m
ohh thx I heard that Kotlin and JPA don't work well together, so
a
They work quite well in my opinion, there's a few gotchas to be aware of, but the jetbrains team have come up with a couple of guides in their blog to ensure everyone follows them, worth a read (some links are in the messages above)
j
Exposed is the way, but tbh we use it mostly in KTOR projects, not spring.
m
To be honest, Ktor has a much lower market share compared to Spring..
j
true. Ktor is light and blazingly fast (both in startup and in execution) and works in the suspending world of coroutines, but has way fewer features than Spring. and of course lower market share. (same as kotlin compared to java 馃檪 )
m
:< TT
DAO vs DSL?
s
Exposed (DSL) - in all my spring boot projects - within the last 8 years.
h
In the past work, we selected Kotlin Coroutines/Spring WebFlux/R2dbc/jOOQ(for R2dbc)
b
I'm running JPA with Hibernate; works well with Kotlin
there's a compiler plugin for gradle to handle the noargs constructors for entities; the only thing you need to be aware of is that entities can't be data classes
c
We use sql2o at work and write raw parameterised sql