I want the user to be able to specify the limit (the size of the amount returned) and offset (the first record returned / index returned) in my query method.
Here a
Suppose you are filtering and soring and paging at same time Below @Query will help you
@Query(value = "SELECT * FROM table WHERE firstname= ?1 or lastname= ?2 or age= ?3 or city= ?4 or "
+ " ORDER BY date DESC OFFSET ?8 ROWS FETCH NEXT ?9 ROWS ONLY" , nativeQuery = true)
List filterJobVacancyByParams(final String firstname, final String lastname,
final String age, final float city,int offset, int limit);