通用型分页实体的实现

4 篇文章 0 订阅
2 篇文章 0 订阅

实现方式一

package com.gwx.entity;

import java.util.List;

/**
 * 作者:Alvin
 * 日期:2017年3月6日
 * 时间:上午12:02:49
 * @param <T>
 */
public class PageBean<T> {

    private Integer currentPage;
    private Integer totalPage;
    private Integer currentCount;
    private Integer totalCount;
    private List<T> list;


    public Integer getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }
    public Integer getTotalPage() {
        return totalPage;
    }
    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }
    public Integer getCurrentCount() {
        return currentCount;
    }
    public void setCurrentCount(Integer currentCount) {
        this.currentCount = currentCount;
    }
    public Integer getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }
    public List<T> getList() {
        return list;
    }
    public void setList(List<T> list) {
        this.list = list;
    }

}

实现方式二

package com.gwx.utils;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

/**
 * 作者:Alvin
 * 日期:2017年3月24日
 * 时间:下午4:18:57
 * 描述:这是一个分页的实体类,适用于easyui框架
 */
public class PageBean {

    private int currentPage;
    private int pageSize;
    private Long total;
    private DetachedCriteria dc;    //存放查询条件
    private List<?> rows;       //存放查询后的结果

    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public Long getTotal() {
        return total;
    }
    public void setTotal(Long total) {
        this.total = total;
    }
    public DetachedCriteria getDc() {
        return dc;
    }
    public void setDc(DetachedCriteria dc) {
        this.dc = dc;
    }
    public List<?> getRows() {
        return rows;
    }
    public void setRows(List<?> rows) {
        this.rows = rows;
    }

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值