pramoth / specification-with-projection

Support projections with JpaSpecificationExecutor.findAll(Specification,Pageable) for Spring Data JPA
MIT License
164 stars 56 forks source link

Unpaged findAll() #25

Open v-ladynev opened 2 years ago

v-ladynev commented 2 years ago

Added two unpaged findAll methods

<R> List<R> findAll(Specification<T> spec, Class<R> projectionClass);

<R> List<R> findAll(Specification<T> spec, Class<R> projectionClass, Sort sort);

The first method can be emulated by using an existing paged findAll() method with Pageable.unpaged(). But it is not an obvious solution.

The second method much more complex to emulate, because it needs to create a new class that supports unpaged behavior with ability to provide sorting.

This pull request was inspired by @sic-sic changes. Many thanks to him.

Fixes https://github.com/pramoth/specification-with-projection/issues/16