Kotlin JPA and Spring Data
IntelliJ IDEA 2018.3 comes with better JPA and Spring Data support for Kotlin. The IDE can automatically inject JPQL into query strings, providing completion for entity names and parameters:Named queries are also supported:
Spring Data interfaces can now also be written in Kotlin, and IntelliJ IDEA will understand the entities you use. It provides you with smart completion for method names and quick-fixes for parameters:
Also, custom queries with Expression Language variables are now supported:
Please try using JPA and Spring Data with Kotlin and share your experience with us.
More posts about Kotlin with Spring support in IntelliJ IDEA are coming. Please stay tuned!
The previous post can be found here.
kydinh says:
December 20, 2018Can I select special columns like bellow in Kotlin JPA?
SELECT Country(c.name, c.capital.name) FROM Country AS c
Nicolay Mitropolsky says:
December 20, 2018Sure. The JPAQL syntax is the same regardless of the “host”-language you use.
DINH QUOC KY says:
December 21, 2018thank you!