I need to paginate table which displays filtered data from one DB table. For example, I have a CARS table, and I need to paginate only ... WHERE CAR = "BMW". So far, I used JPA repository.findAll(Pageable pageable) method, if I paged data from one table only.
Is there any standard way to achieve this using standard repository methods, or do I have to write my own implementation? Thanks.
Take a look to:
I think this is what you are looking for.
Specification<T>, is basically an object to specify a WHERE clause which will filter your query.Javadoc here.
An example (without
Pageable) here.