spring-projects / spring-projects/spring-data-commons
Pageable inconsistent with hateoas pagemetadata int/long
@odrotbohm is already working on this.
Since Aug 12, 2024.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
I just noticed that the spring data interface pageable uses int for page number and page size, but the PageMetaData from the PagedModel in spring hateoas uses long for size, totalElements, totalPages and number.
This makes in unnecessary hard to combine both paging approaches within the spring libs.
In terms of expected values it won't be a problem to simply cast, one to the other, because you seldom would have more pages than max_int.
Nevertheless, this would be good to harmonize.
This is why I created the issue here, because it should be better to upgrade ints to long, than reduce the long to int. (even though it should hopefully not lead to errors)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.