日期:2014-05-17 浏览次数:20690 次
public String editStuScholarship() { String currentTime = TimeGenerator.getCurrentTime(); try { Evaluatescholarship _evaluatescholarship = this.evaluateScholarshipService.findById(evaluatescholarship.getEno()); if (null == _evaluatescholarship) { return "input"; } Stubasicinfo stubasicinfo = _evaluatescholarship.getStubasicinfo(); Rewardsys rewardsys = _evaluatescholarship.getRewardsys(); Majorinfo majorinfo = _evaluatescholarship.getStubasicinfo().getMajorinfo(); stubasicinfo.setStbStuNo(evaluatescholarship.getStubasicinfo().getStbStuNo()); stubasicinfo.setStbName(evaluatescholarship.getStubasicinfo().getStbName()); stubasicinfo.setSyear(evaluatescholarship.getStubasicinfo().getSyear()); majorinfo.setMname(evaluatescholarship.getStubasicinfo().getMajorinfo().getMname()); rewardsys.setRrank(evaluatescholarship.getRewardsys().getRrank()); stubasicinfo.setMajorinfo(majorinfo); _evaluatescholarship.setStubasicinfo(stubasicinfo); _evaluatescholarship.setRewardsys(rewardsys); //_evaluatescholarship.setStubasicinfo(stubasicinfo) this.evaluateScholarshipService.update(_evaluatescholarship); System.out.println("action getEno = "+id); logger.info(currentTime + " 用户【" + evaluatescholarship + "】登录:"); //ActionContext.getContext().put("allList", _list); if(stuType==1){ return "success_master"; } else{ return "success_doctor"; } } catch (Exception e) { // logger.info(" ******************** Method: [execute] ******************** " + // "throw an exception,the reason may be username or password is wrong!"); e.printStackTrace(); return "input"; } }
/** * 向数据库更新一条对应于一个业务对象实例的记录 * * @param entity 业务对象实例 */ public void update(Object entity) throws DaoException { try { System.out.println("update sucess"); getHibernateTemplate().update(entity); System.out.println("111"); } catch (DataAccessException e) { System.out.println("update failed" ); logger.error("向数据库更新 " + entity.getClass().getName() + " 的记录失败", e); throw new DaoException("更新 " + entity.getClass().getName() + " 实例到数据库失败", e); } }