public void updateCustomList(CustomList customList) {
Session session = customListDAO.getSession();
Transaction trans = null;
try{
trans = session.beginTransaction();
customListDAO.merge(customList);
trans.commit();
}catch(RuntimeException re){
trans.rollback();
}finally{
session.close();
}
}
解决方案 »
- 关于线程的一个问题
- jquery+struts2+spring框架搭建问题,大侠们帮忙看看
- 把myeclipse项目放自eclipse上不能部署
- 编译servlet时无法访问到bean bean文件能编译
- 如何让hibernate不缓存?
- spring+hibernate开发问题!
- java 开发Webservice客户端获取服务端数据存入本地数据库
- 昨天刚装的wsad,今天就无法启动,谁有wsad的许可证
- shiro 自定义过滤器如何当无权限时返回json字符串?
- spring+Junit测试 Failed to load ApplicationContext
- 公司打算在开源项目wildfire + spark IM的基础上二次开发,有经验的朋友给些建议!
- 请教大家一个问题,就是model与vo转换的问题,我们在表现层中使用model装载数据,然后在持久层中(如Hibernate)使用VO装载数据,现在持
import com.jfsuite.util.db.BaseHibernateDAO;public class CustomListDAO extends BaseHibernateDAO { private static final String LOAD_ALL = "from CustomList"; public List findAll() {
Query queryObject = getSession().createQuery(LOAD_ALL);
return queryObject.list();
} public CustomList findById(Integer id) {
return (CustomList) getSession().get(CustomList.class, id);
} public void save(CustomList customList) {
getSession().saveOrUpdate(customList);
}
public void delete(CustomList customList){
getSession().delete(customList);
}
public void delete(Integer id){
getSession().delete(findById(id));
}}
是不是你缓存页面了?
不要缓存页面试试>>>该怎么设置?