Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin data class with spring jpa

I have read the spring guide with kotlin and its says data class for JPA is not recommended

but i am quite confused after seeing some tutorials and video using data class for JPA

did spring find a way to deal with data class in new versions?

like image 710
klaus Avatar asked Mar 03 '26 16:03

klaus


1 Answers

We have developed several services with Spring and Kotlin and used data classes as e.g. entities. This works fine and leads to a lot less boilerplate. You do, however, need to configure your project with these build options/dependencies to avoid Spring interoperability issues:

https://kotlinlang.org/docs/all-open-plugin.html

like image 82
Erik Finnman Avatar answered Mar 06 '26 07:03

Erik Finnman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!