1

this is my first project doing jhipster (microservice : Spring boot - Angular) and we have implemented the pagination for most of our findRequests.
We have set the MAX_ITEMS_PER_PAGE to 20 during the project generation and that's perfect.
But for some reason when i ask for more then 20 items even when specifying the Number.MAX_SAFE_INTEGER as the page size i still get 20 items max but if i ask for 10 items i get the 10 items.
Is there a way to disable this behaviour ?

Big Zed
  • 417
  • 5
  • 11
  • Have you read https://stackoverflow.com/questions/23751193/spring-data-jpa-limit-pagesize-how-to-set-to-maxsize – Gaël Marziou May 18 '22 at 06:24
  • I just read it, it gives more information on how to manage pages but it doesn't give the response to my question. I was asking to get the page size I wanted. But I have found what was the problème, il will post it in a sec. – Big Zed May 19 '22 at 11:10

1 Answers1

1

The problem lies in the fact that in JavaScript the Number.MAX_SAFE_INTEGER equals to 9007199254740991 while in java the max value that an int can get is 2 billion minus 1 (i.e. 1 999 999 999) and it was giving me the default size as it couldn't cast the value to int.

Big Zed
  • 417
  • 5
  • 11