spring-data icon indicating copy to clipboard operation
spring-data copied to clipboard

PagingAndSortingRepository fails for Pageable.unpaged()

Open aburmeis opened this issue 3 years ago • 0 comments

Any call to PagingAndSortingRepository.findAll() passing Pageable.unpaged() fails with a NullPointerException. The reason is the PageImpl is created using CursorEntity.Stats.getFullCount() which is null. The fix would be to change the creation of AqlQueryOptions in SimpleArangoRepository.findAllInternal():

return arangoOperations.query(query, bindVars,
				pageable != null ? new AqlQueryOptions().fullCount(true) : null, domainClass);

Currently the option fullCount(true) is only used if pageable.isPaged() but that is wrong. The bug can be reproduced with spring data 3.7.0.

aburmeis avatar Jul 26 '22 08:07 aburmeis