📄 configfilethirdkindbiz.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.dao.ConfigFileThirdKindDao;
import org.better.hr.entity.ConfigFileThirdKind;
import org.better.hr.exception.HrException;
public class ConfigFileThirdKindBiz {
private static final Log logger = LogFactory.getLog(ConfigFileSecondKindBiz.class);
private ConfigFileThirdKindDao configfilethirdkindDao;
public ConfigFileThirdKindDao getConfigfilethirdkindDao() {
return configfilethirdkindDao;
}
public void setConfigfilethirdkindDao(
ConfigFileThirdKindDao configfilethirdkindDao) {
this.configfilethirdkindDao = configfilethirdkindDao;
}
/**
* 根据ID号返回对象
* @param id 主键id
* @return 对象
* @throws HrException
*/
public ConfigFileThirdKind getCFFKbyID(java.io.Serializable id) throws HrException
{
try
{
return this.getConfigfilethirdkindDao().load(id);
}
catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 新增
* @param cfsk 新增的对象
* @return 新产生的二级机构编号
* @throws HrException
*/
public String add(ConfigFileThirdKind condition) throws HrException {
try {
condition.setFirstKindId(this.genCFSKId());
// 保存到数据库
this.getConfigfilethirdkindDao().add(condition);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
return condition.getFirstKindId();
}
/**
* 查询显示列表
* @param condition 包含查询条件的对象
* @return 查询结果列表
* @throws HrException
*/
public List list(ConfigFileThirdKind condition) throws HrException {
try {
return this.getConfigfilethirdkindDao().find(condition);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 更新对象到数据库
* @param condition 已更新的对象
* @throws HrException
*/
public void update(ConfigFileThirdKind condition) throws HrException {
try {
this.getConfigfilethirdkindDao().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.getConfigfilethirdkindDao().delete(id);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 生成二级机构编号
* @return 新产生的二级机构编号
*/
public String genCFSKId()
{
int num = this.getConfigfilethirdkindDao().find(null).size()+ 1;
return num>10? (num+"") : ("0"+num);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -