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

📄 u04c1bo.java

📁 持久层hibernate技术使用的一个例子
💻 JAVA
字号:
package cn.hope.front.bo;

import java.util.List;



import org.apache.log4j.Logger;


import cn.hope.front.pojo.Student;
import cn.hope.front.pojo.U07CommonListVO;
import cn.hope.front.pojo.dao.SClassDAO;
import cn.hope.front.pojo.dao.StudentDAO;
import cn.hope.front.util.U07Page;


public class U04C1BO {
Logger log = Logger.getLogger(U04C1BO.class.getName());
	
	SClassDAO sClassDAO = new SClassDAO();
	StudentDAO studentDAO = new StudentDAO();
	
	
	public List aroundValueClass() throws Exception{
		List list = null;
		try{
			list = sClassDAO.searchAround();
		}
		catch(Exception e){
			log.error(e);
			e.printStackTrace();
			throw new Exception(e);
		}
		return list;
	}
	
	
	
	public U07CommonListVO serach(Student student,int start, boolean isEq)throws Exception {
		U07CommonListVO cl_vo = new U07CommonListVO();
		int range = 10;// 每页显示记录数
		int count = 0;// 总记录数
		List list = null;// 查询得到的结果集
		U07Page page = new U07Page();// 分页
		String fenyeStr = "";
		try {
			
			list = studentDAO.searchAroundinfo(student, start, range, isEq);//得到结果集
			count = studentDAO.getCount();
			cl_vo.setRs(list);
			cl_vo.setCount(count);
			cl_vo.setStart(start);
			cl_vo.setRange(range);
		
			fenyeStr = page.fenye(cl_vo);
			cl_vo.setFenye(fenyeStr);
			cl_vo.setCurrentPage(page.getCurrentPage());
			cl_vo.setTotalPage(page.getTotalPage());
			cl_vo.setStartSub(page.getStartSub());
			cl_vo.setOverSub(page.getOverSub());
		} catch (Exception e) {
			log.error(e);
			e.printStackTrace();
			throw new Exception(e);
		}
		return cl_vo;
	}
	
	
}

⌨️ 快捷键说明

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