📄 userinfordao.java
字号:
package com.jack.user.dao.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.jack.user.dao.IUserInforDAO;
import com.jack.user.pojo.UserInfor;
public class UserInforDAO extends HibernateDaoSupport implements IUserInforDAO{
private static final Log log = LogFactory.getLog(UserInforDAO.class);
public void saveUserInformation(UserInfor userInfor)
throws RuntimeException {
log.debug("saving UserInfor instance");
getHibernateTemplate().save(userInfor);
log.debug("save successful");
}
public void updateUserInformation(UserInfor userInfor)
throws RuntimeException {
this.getHibernateTemplate().update(userInfor);
}
public UserInfor findUserInformationById(String id) throws RuntimeException {
log.debug("getting UserInfor instance with id: " + id);
UserInfor instance = (UserInfor) getHibernateTemplate().get(
"com.jack.user.pojo.UserInfor", id);
return instance;
}
public static UserInforDAO getFromApplicationContext(ApplicationContext ctx) {
return (UserInforDAO) ctx.getBean("UserInforDAO");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -