spring-data
spring-data copied to clipboard
PagingAndSortingRepository fails for Pageable.unpaged()
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.