Package com.github.miemiedev.mybatis.paginator.domain

Examples of com.github.miemiedev.mybatis.paginator.domain.PageList


                    }
                    return new Paginator(pageBounds.getPage(), pageBounds.getLimit(), count);
                }
            };
            Future<Paginator> countFutrue = call(countTask, async);
            return new PageList(listFuture.get(),countFutrue.get());
        }

        return listFuture.get();
  }
View Full Code Here


            Object element = enumeration.nextElement();
            if(element instanceof String){
                String name = (String)element;
                Object attr = request.getAttribute(name);
                if(attr instanceof PageList){
                    PageList pageList = (PageList)attr;
                    //原属性加后缀
                    request.setAttribute(name+"Paginator", pageList.getPaginator());
                }
            }
        }
        if(modelAndView != null){
            Map<String,Object> model = modelAndView.getModel();
            Map<String,Object> newModel = new HashMap<String, Object>();
            for(Map.Entry<String, Object> item : model.entrySet()){
                Object attr = item.getValue();
                if(attr instanceof PageList){
                    PageList pageList = (PageList)attr;
                    //原属性加后缀
                    newModel.put(item.getKey()+"Paginator", pageList.getPaginator());
                }
            }
            modelAndView.addAllObjects(newModel);
        }
    }
View Full Code Here


        List list = findByCity("BeiJing",pageBounds);

        //Get totalCount
        PageList pageList = (PageList)list;
        System.out.println("totalCount: " + pageList.getPaginator().getTotalCount());

        //Convert to json , for spring mvc
        ObjectMapper objectMapper = new PageListJsonMapper();
        System.out.println(objectMapper.writeValueAsString(list));
    }
View Full Code Here

TOP

Related Classes of com.github.miemiedev.mybatis.paginator.domain.PageList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.