📄 usersbiz.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.UsersDao;
import org.better.hr.entity.Users;
import org.better.hr.exception.HrException;
public class UsersBiz {
private static final Log logger = LogFactory.getLog(ConfigFileFirstKindBiz.class);
private UsersDao usersDao;
public UsersDao getUsersDao() {
return usersDao;
}
public void setUsersDao(UsersDao usersDao) {
this.usersDao = usersDao;
}
/**
* 根据ID号返回对象
* @param id 主键id
* @return 对象
* @throws HrException
*/
public Users getbyID(java.io.Serializable id) throws HrException
{
try
{
return (Users)this.getUsersDao().load(Users.class,id);
}
catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 新增用户
* @param condition
* @throws HrException
*/
public void add(Users condition) throws HrException {
try {
//保存到数据库
this.getUsersDao().add(condition);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询用户
* @param condition
* @return
* @throws HrException
*/
public List list(Users condition) throws HrException{
try{
return this.getUsersDao().find(condition);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 变更
* @param condition
* @throws HrException
*/
public void update(Users condition) throws HrException{
try{
this.getUsersDao().update(condition);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -