deptservice.java
来自「struts+spring +hibernate查询分页」· Java 代码 · 共 56 行
JAVA
56 行
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 + =
减小字号Ctrl + -
显示快捷键?