Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-1118

Automatically determine Kotlin parameter names in repository methods

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:

      Description

      In web-mvc I can declare a method where the parameter name is automatically picked up:

      Unable to find source-code formatter for language: kotlin. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      @GetMapping fun foo(@RequestParam bar: String): Any { ... }
      

      When I try to create a custom method with arguments in a spring-data-jpa repository interface it doesn't work with the following message:

      IllegalArgumentException: Name for parameter binding must not be null or empty! For named parameters you need to use @Param for query method parameters on Java versions < 8.

      It would be convenient If this also worked without having to specify @Param("name").

      I'm using Kotlin 1.1 on JDK8 with no special compilation options.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olivergierke Oliver Drotbohm
                Reporter:
                cleiter Christoph Leiter
                Last updater:
                S├ębastien Deleuze
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: