Skip to content

Commit

Permalink
OLMIS-2534: Renamed DEFAULT_PAGE_SIZE to NO_PAGINATION
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Lewczyński committed Aug 29, 2017
1 parent bfdd92e commit 7bc510a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
resolver.setFallbackPageable(
new PageRequest(Pagination.DEFAULT_PAGE_NUMBER, Pagination.DEFAULT_PAGE_SIZE));
new PageRequest(Pagination.DEFAULT_PAGE_NUMBER, Pagination.NO_PAGINATION));
argumentResolvers.add(resolver);
super.addArgumentResolvers(argumentResolvers);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/openlmis/report/utils/Pagination.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class Pagination {
public static final int DEFAULT_PAGE_NUMBER = 0;

/*
Default number of element that would be retrieved if page size is not provided.
Use this constant if you want to return all elements.
*/
public static final int DEFAULT_PAGE_SIZE = 2000;
public static final int NO_PAGINATION = Integer.MAX_VALUE;


/**
Expand All @@ -56,7 +56,7 @@ public static int getPageNumber(Pageable pageable) {
*/
public static int getPageSize(Pageable pageable) {
if (pageable == null) {
return DEFAULT_PAGE_SIZE;
return NO_PAGINATION;
} else {
return pageable.getPageSize();
}
Expand Down

0 comments on commit 7bc510a

Please sign in to comment.