摘要: 实体更新 Transaction trans=session.beginTransaction(); String hql=”update User user set user.age=20 where user.age=18”; Query queryupdate=session.createQuery(hql); int ret=queryupdate.executeUpdate(); trans.commit(); 实体删除 Transaction trans=session.beginTransaction(); String hql=”delete fr... 阅读全文
posted @ 2011-11-22 09:24 chenchun 阅读(8138) 评论(0) 推荐(0) 编辑
摘要: 用拦截器实现登录验证功能AuthorizationInterceptor :packagecom.interceptor;importcom.opensymphony.xwork2.ActionInvocation;importcom.opensymphony.xwork2.interceptor.*;importcom.opensymphony.xwork2.*;importjava.util.*;/***@authorhttp://xp9802.iteye.com/*/publicclassAuthorizationInterceptorextendsAbstractInterceptor 阅读全文
posted @ 2011-11-22 09:23 chenchun 阅读(4061) 评论(0) 推荐(0) 编辑