⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pagebean.java

📁 基于Struts+Spring+hibernate的Hibernate分页
💻 JAVA
字号:
package com.st0705.erp.base;
public class PageBean{
	private int pag;//当前显示第几页
	private int first;//从第几页开始
	private int size;//查询最多条数
	private int count;//获取查询所有记录条数
	private int total;//共有几页
	public int getFirst() {
		return first;
	}
	public void setFirst(int first) {
		this.first = first;
	}
	public int getPag() {
		return pag;
	}
	public void setPag(int pag) {
		if(pag<=0){
			this.first=0;
			this.pag=0;
		}else if(pag>=total){
			if(count%size==0){
				this.first=count-size;
			}else{
				this.size=count%size;
				this.first=count-size;
			}
			this.pag=total-1;
		}else{
			this.first=(pag)*size;
			this.pag=pag;
		}
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count=count;
		if(count%size==0){
			total=(int)(Math.ceil(count/size));	
		}else{
			total=(int)(Math.ceil(count/size)+1); 
		}
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -