JpaSpecificationExecutor's method findBy() does not use Sort object from provided Pageable object.
I try to use findBy() method of JpaSpecificationExecutor to be able mixing specification and projection, e.g.:
var someSort = Sort.by(Sort.Direction.DESC, "someFiled");
var somePageable = PageRequest.of(0, 100, someSort);
someRepository.findBy(someSpecification, q -> q.as(SomeProjection.class).page(somePageable));
But the code above ignores my custom sorting.
I can see from the source code, that it really doesn't use Sort object from provided Pageable object.
FetchableFluentQueryBySpecification's page() method uses createSortedAndProjectedQuery() method under the hood which uses default sorting(Sort.unsorted()) instead of provided one.
Everything works as expected If I use 'sortBy()' method with provided custom sorting object, but why should I provide Sort object separately instead of just providing it with Pageable object?
Should it work like this or it's a bug ?