VanRoy / spring-data-jest

Spring Data Implementation for Jest
Apache License 2.0
226 stars 78 forks source link

Fix for Issue #122: Modify the startRecord calculation to use the Pageable.getOffset method #123

Closed jbogan closed 5 years ago

jbogan commented 5 years ago

The previous startRecord calculation used the Pageable.getPageNumber and Pageable.getPageSize methods to retrieve the start record. This works fine for the standard PageRequest but can cause a problem for custom Pageable implementations that do not use a true "page".

Since the current calculation is the same as the Pageable.getOffset method's calculation, this PR adjusts the code to use the Pageable.getOffset method.