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

📄 operarelogdao.java

📁 这是本人以前在学校时
💻 JAVA
字号:
package com.funddeal.model.dao.operare_log;

import java.util.Collection;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Query;

import com.funddeal.base.PublicFunction;
import com.funddeal.base.SessionCommit;
import com.funddeal.model.pojo.custom_entity.PaginactionParamEntity;
import com.funddeal.model.pojo.operare_log.OperareLog;

public class OperareLogDAO {
	SessionCommit sc;
	public static String errorMsg;
	
	public OperareLogDAO() throws HibernateException{
		sc=new SessionCommit();
	}
	
	/**
	 * 添加一条日志
	 * @param operLog:日志实体
	 * @return 日志的主键
	 * @throws HibernateException
	 */
	public String addOperLogDao(OperareLog operLog) throws HibernateException{
		return(String)sc.getSessionAdd(operLog);
	}
	
	/**
	 * 删除一条日志
	 * @param operLog:日志实体
	 * @return True|False(成功与否)
	 */
	public boolean delOperLogDao(OperareLog operLog){
		boolean bl=false;
		errorMsg="";
		bl=sc.getSessionDelete(operLog);
		if(!bl)errorMsg=SessionCommit.errorMsg;
		return  bl;
	}
	
	/**
	 * 修改日志
	 * @param operLog:日志实体
	 * @return True|False(成功与否)
	 */
	public boolean updateOperLogDao(OperareLog operLog){
		boolean bl=false;
		errorMsg="";
		bl=sc.getSessionUpdate(operLog);
		if(!bl)errorMsg=SessionCommit.errorMsg;
		return bl;
	}
	
	/**
	 * <b>获得日志数据集</b>(带分页功能)
	 * @param ppe:分页实体
	 * @return List集合
	 */
	public Collection SearchOperLogDao(PaginactionParamEntity ppe){
		errorMsg="";
		Collection col=null;
		if(!ppe.getHql().equals("")){
			errorMsg="参数值不能为空!";
			return col;
		}
		PublicFunction pf=new PublicFunction();
		Query query=pf.search(ppe);
		int cut=0;
		try {
			cut=query.list().size();
			if(cut<=0){
				if(PublicFunction.errorMsg.equals(""))
					errorMsg="没有记录";
				else
					errorMsg=PublicFunction.errorMsg;
				return col;
			}
			col=query.list();
		} catch (HibernateException e) {
			errorMsg=e.getMessage();
		}
		return col;
	}
}

⌨️ 快捷键说明

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