I am planning to use PagingAndSortingRepository interface methods and wanted to understand how do we specify what query to run on calling the method such as findAll?
Asked
Active
Viewed 620 times
-1
-
read this tutorial https://docs.spring.io/spring-data/data-commons/docs/1.6.1.RELEASE/reference/html/repositories.html – Youcef LAIDANI Oct 30 '17 at 06:58
-
It is not at all clear what your asking. This? https://stackoverflow.com/questions/21734149/namedquery-override-findall-in-spring-data-rest-jparepository/21751130#21751130 – Alan Hay Oct 30 '17 at 10:22
1 Answers
0
I'm assuming JPA, but other stores work the same or in case of annotating the entity model similar.
Normally you don't. Spring Data figures out these queries on your behalf. If you want a different query to be executed than the one Spring Data picks, you have the usual choices for custom methods in Spring Data:
If you only need to change table or column names you can annotate your entity model.

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