Category: Java

  • Neat repository trick for JPA and Spring Boot

    Neat repository trick for JPA and Spring Boot

    When working with Spring Boot and JPA, I’m a fan of declaring simple repository interfaces. But what if you want to reference a static code variable in the query, instead of typing it in manually, which is errorprone and not refactor-friendly? Here’s how. The challenge Here’s a typical JPA interface, with a custom query: Now,…