c453dao.java

来自「使用spring ,hibernate 框架的稽查管理系统」· Java 代码 · 共 37 行

JAVA
37
字号
package com.je.ims.dao;

import java.util.List;

import com.je.ims.hibernate.ChiefReport;

public class C453DAO extends CommonDAO {

	public C453DAO() {
		super();
	}

    //查询所有记录
    public List getAll(Long year,Long month) {
		String hql="select distinct cr from ChiefReport as cr where cr.year="+year+"and cr.month="+month+"and (cr.editState=1 or cr.editState=2 or cr.editState=3 or cr.editState=7)";
		List list=this.getHibernateTemplate().find(hql);
		return list;
	}
    //返回记录, start为记录开始的位置,size为记录的长度
    public Object[] getCount(int start, int size){
    	return null;
    }

	public Object[] getCount(int start, int count, List l) {
		List list=l;
        ChiefReport[] report = new ChiefReport[count];
		
		for (int i=0;i<count;i++)
		{
			report[i]=new ChiefReport();
			report[i]=(ChiefReport)list.get(i+start);
		}
		return report;
	}

}

⌨️ 快捷键说明

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