1

In repository interface which extends JpaRepository, if we have our custom query e.g "getAllCustomersWhoAreOlderThan", how can we pass custom specification to this method?

  • Possible duplicate of [Can I combine a @Query definition and Specifications on one Spring Data JPA repository method?](https://stackoverflow.com/questions/26379522/can-i-combine-a-query-definition-and-specifications-on-one-spring-data-jpa-repo) – ValerioMC Mar 21 '19 at 11:31
  • I didn't get any resolution from this thread. So I asked the question – AJ Winchester Mar 22 '19 at 12:48

1 Answers1

0

you can't pass Specifications in mix @Query (or query-methods). the following queries using Specifications:

  • count(Specification spec)
  • List findAll(Specification spec)
  • Page findAll(Specification spec, Pageable pageable)
  • List findAll(Specification spec, Sort sort)
  • T findOne(Specification spec)
zohreh
  • 913
  • 1
  • 7
  • 9