67,512
社区成员
发帖
与我相关
我的任务
分享
BaseDao:
public <T> void update(T obj);
BaseDaolmpl:
private SessionFactory sessionFactory;
public <T> void update(T obj){
sessionFactory.getCurrentSession().update(obj);
}
EmpDao:
public Emp update(Emp obj) throws Exception;
EmpDaoImpl:
private BaseDao ibaseDao;
public Emp update(Emp obj) throws Exception{
ibaseDao.update(obj);
return obj;
}
EmpService:
public Emp update(Emp obj) throws Exception;
EmpServiceImpl:
private EmpDao empDao;
public Emp update(Emp obj) throws Exception{
obj=empDao.update(obj);
return obj;
}
EmpAction:
private EmpService empService;
public void update(){
Emp emp=this.getModel();
try{
empService.update(emp);
}catch(){}
}