0

How to do

@Query("SELECT DISTINCT area FROM Curso ORDER BY area")
    public List<String> findDistinctArea();

With Spring-data JPA query creation? (Without the @Query annotation)

I'm trying just List<String> findDistinctArea(); but it just throw No property findDistinctArea found for type Curso!

Thanks for any help !

1 Answers1

0

This is not possible with query derivation.

The real question is why do you want to avoid the annotation? If you have some limit on the number of annotations you may use you can make it a named query and store it in a properties file.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348