-
Type: Improvement
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 0.15
-
Fix Version/s: 0.17
-
Labels:
now:
int topicsCount = topicService.getTopicsPastLastDayCount(lastLogin); Pagination pag = new Pagination(page, size, topicsCount); List<Topic> topics = topicService.getAllTopicsPastLastDay(pag.getStart(), pag.getPageSize(), lastLogin); return new ModelAndView(..) .addObject("maxPages", pag.getMaxPages()) .addObject(PAGE, pag.getPage())
Refactoring:
move Pagination class to service module
create class PaginationResult for collection and data needed by controller (page, max pages, etc)
for each paginated entity (Topic, Post etc) create one service method that returns PaginationResult and encapsulate querying total count, pagination logic, querying list of objects and populating PaginationResult
- duplicates
-
JC-760 Revise mechanism for pagination
- Closed