Java 8 Spring Data JPA Parameter binding

前端 未结 3 681
轻奢々
轻奢々 2021-01-11 09:35

In my @Repository interface I created custom find method with JPQL @Query that contains parameter (addressType).

from Address a where a.addressType = :addressT

3条回答
  •  醉梦人生
    2021-01-11 10:08

    The answer given by @JB Nizet is correct, but I just wanted to point out the way to add the -parameters flag for the Java 8 compiler when using Eclipse. This is in Window -> Preferences:

    Preferences setting

    Maven also allows adding the flags in the pom itself:

    
        org.apache.maven.plugins
        maven-compiler-plugin
        3.5.1
        
            
                -verbose
                -parameters
            
        
    
    

    To add parameters flag for Java 8 compiler when using IDEA IntelliJ

    File > Settings > Build, Execution, Deployment > Compiler > Java Compiler

    Java Compiler setting

提交回复
热议问题