Features Tips & Tricks

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:JPACompletion-fullNamed queries are also supported:JPANamed-fullSpring 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:SpringDataRepo-fullAlso, custom queries with Expression Language variables are now supported:SpringDataCustomQuery-fullPlease 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.

Comments below can no longer be edited.

3 Responses to Kotlin JPA and Spring Data

  1. Avatar

    kydinh says:

    December 20, 2018

    Can I select special columns like bellow in Kotlin JPA?
    SELECT Country(c.name, c.capital.name) FROM Country AS c

    • Avatar

      Nicolay Mitropolsky says:

      December 20, 2018

      Sure. The JPAQL syntax is the same regardless of the “host”-language you use.

      • Avatar

        DINH QUOC KY says:

        December 21, 2018

        thank you!

Discover more