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

📄 deptservice.java

📁 struts+spring +hibernate查询分页
💻 JAVA
字号:
package com.baidu.service;

import java.io.Serializable;
import java.util.List;
import com.baidu.base.*;
import com.baidu.dao.IDeptDAO;

import com.baidu.hibernate.pojo.Zhangshan;

public class DeptService implements IDeptService {

	private IDeptDAO deptDao;
	
	
	public List getResultsByPage(int startIndex, int maxResults) {
		return this.deptDao.getRecordLimited(startIndex, maxResults);
	}
	public int getTotalPage(int size) {
		return this.deptDao.getTotalPage(size);
	}
	
	
	public void setDeptDao(IDeptDAO deptDao){
		this.deptDao = deptDao;
	}
	public IDeptDAO getDeptDao(){
		return this.deptDao;
	}
	
	
	public void deleteDept(Serializable id) {
		this.deptDao.delete(this.deptDao.find(Zhangshan.class, id));
	}

	public List findAll() {
		return this.deptDao.findAll(Zhangshan.class);
	}

	public Zhangshan findById(Serializable id) {
		return (Zhangshan)this.deptDao.find(Zhangshan.class, id);
	}

	public Serializable saveDept(Zhangshan zs) {
		return this.deptDao.save(zs);
	}

	public Serializable updateDept(Zhangshan zs) {
		this.deptDao.update(zs);
		return zs.getFldDeptId();
	}

	public int getTotalRecords(){
		return this.deptDao.getTotalResults();
	}
}

⌨️ 快捷键说明

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