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

📄 engagemajorreleasebiz.java

📁 hr伯乐管理系统!非常适合java学员做学习参考用!是用集成框架开发的Struts+hrbernet+Spring 开发的
💻 JAVA
字号:
package org.better.hr.biz;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.better.hr.comm.Util;
import org.better.hr.dao.EngageMajorReleaseDao;
import org.better.hr.entity.EngageMajorRelease;
import org.better.hr.exception.HrException;

public class EngageMajorReleaseBiz {
	
	private static final Log logger = LogFactory.getLog(ConfigFileFirstKindBiz.class);
	private EngageMajorReleaseDao engagemajorreleaseDao;

	public EngageMajorReleaseDao getEngagemajorreleaseDao() {
		return engagemajorreleaseDao;
	}

	public void setEngagemajorreleaseDao(EngageMajorReleaseDao engagemajorreleaseDao) {
		this.engagemajorreleaseDao = engagemajorreleaseDao;
	}
	/**
	 * 根据ID号返回对象
	 * @param id 主键id
	 * @return 对象
	 * @throws HrException
	 */
	public EngageMajorRelease getEMRbyID(java.io.Serializable id) throws HrException
	{
		try
		{
			return this.getEngagemajorreleaseDao().load(id);
		}
		catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 新增
	 * @param cffk 新增的对象
	 * @return 新产生的一级机构编号
	 * @throws HrException
	 */
	public void add(EngageMajorRelease condition) throws HrException {
		try {
			condition.setDeadline(Util.parseDate(condition.getStr_deadline()));  //将字符串类型转换为日期类型,以便和数据库字段类型对应
			condition.setRegistTime(Util.parseDate(condition.getStr_registTime()));//将登记时间转换为日期类型
			/**
			 * 得到下拉框中带有编号和名称的字符串数组,以"/"分开,然后再插入数据库中
			 * 为实体中的 firstkindid 和 firstkindname 赋值 
			 */
			String[] args = Util.splitIdAndName(condition.getFirstKindName());
			condition.setFirstKindId(args[0]);
			condition.setFirstKindName(args[1]);
			/**
			 * 得到下拉框中带有编号和名称的字符串数组,以"/"分开,然后再插入数据库中
			 * 为实体中的 secondkindid 和 secondkindname 赋值 
			 */
			args = Util.splitIdAndName(condition.getSecondKindName());
			condition.setSecondKindId(args[0]);
			condition.setSecondKindName(args[1]);
			/**
			 * 得到下拉框中带有编号和名称的字符串数组,以"/"分开,然后再插入数据库中
			 * 为实体中的 secondkindid 和 secondkindname 赋值 
			 */
			args = Util.splitIdAndName(condition.getThirdKindName());
			condition.setThirdKindId(args[0]);
			condition.setThirdKindName(args[1]);
			/**
			 * 得到下拉框中带有编号和名称的字符串数组,以"/"分开,然后再插入数据库中
			 * 为实体中的 majorkindid 和  majorkindname 赋值 
			 */
			args = Util.splitIdAndName(condition.getMajorKindName());
			condition.setMajorKindId(args[0]);
			condition.setMajorKindName(args[1]);
			/**
			 * 得到下拉框中带有编号和名称的字符串数组,以"/"分开,然后再插入数据库中
			 * 为实体中的 majorid 和  majorname 赋值 
			 */
			args = Util.splitIdAndName(condition.getMajorName());
			condition.setMajorId(args[0]);
			condition.setMajorName(args[1]);
			
			// 保存到数据库
			this.getEngagemajorreleaseDao().add(condition);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 查询显示列表
	 * @param condition 包含查询条件的对象
	 * @return 查询结果列表
	 * @throws HrException
	 */
	public List list(EngageMajorRelease condition) throws HrException {
		try {
			return this.getEngagemajorreleaseDao().find(condition);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 更新对象到数据库
	 * @param condition 已更新的对象
	 * @throws HrException
	 */
	public void update(EngageMajorRelease condition) throws HrException {
		try {
			condition.setDeadline(Util.parseDate(condition.getStr_deadline()));  //将字符串类型转换为日期类型,以便和数据库字段类型对应
			condition.setRegistTime(Util.parseDate(condition.getStr_changeTime()));//将登记时间转换为日期类型
			
			this.getEngagemajorreleaseDao().update(condition);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 删除数据库对象
	 * @param id 对象的主键编号
	 * @throws HrException
	 */
	public void delete(java.io.Serializable id) throws HrException
	{
		try {
			this.getEngagemajorreleaseDao().delete(id);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
}

⌨️ 快捷键说明

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