资源简介
存在员工级联保存更新的BUG,设置了级联属性,但是没有起作用
代码片段和文件信息
package com.employee.action;
import com.employee.domain.Department;
import com.employee.domain.PageBean;
import com.employee.service.DepartmentService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
/**
* 部门action
* @author Administrator
* @date 2016年12月24日
*/
@SuppressWarnings(“serial“)
public class DepartmentAction extends ActionSupport implements ModelDriven{
//struts结合spring自动注入的department
private Department department = new Department();
public Department getModel() {
return department;
}
//spring注入departmentService
private DepartmentService departmentService;
public void setDepartmentService(DepartmentService departmentService) {
this.departmentService = departmentService;
}
//接收当前页面的值
private int currentPage = 1;
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
//分页查询部门
public String findAll(){
PageBean pageBean = departmentService.findByPage(currentPage);
//将pageBean存入到值栈中
ActionContext.getContext().getValueStack().push(pageBean);
return “findAll“;
}
//通过action返回添加部门的视图
public String saveUI(){
return “saveUI“;
}
/**
* 保存部门
* @return
*/
//添加部门的save方法
public String save(){
departmentService.save(department);
return “saveSuccess“;
}
/**
* 根据ID查询部门
* @return
*/
public String editById(){
department = departmentService.editById(department.getDid());
return “editSuccess“;
}
/**
* 修改部门
* @return
*/
public String update(){
departmentService.update(department);
return “updateSuccess“;
}
/**
* 删除部门
* @return
*/
public String delete(){
Department dep = departmentService.editById(department.getDid());
departmentService.delete(dep);
return “deleteSuccess“;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-01-12 12:33 ssh_employee\
文件 841 2016-12-24 18:54 ssh_employee\.classpath
文件 1045 2016-12-24 18:54 ssh_employee\.project
目录 0 2017-01-12 12:33 ssh_employee\.settings\
文件 567 2016-12-24 18:54 ssh_employee\.settings\.jsdtscope
文件 364 2016-12-24 18:54 ssh_employee\.settings\org.eclipse.jdt.core.prefs
文件 488 2016-12-24 18:54 ssh_employee\.settings\org.eclipse.wst.common.component
文件 345 2016-12-24 18:54 ssh_employee\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-12-24 18:54 ssh_employee\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-12-24 18:54 ssh_employee\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-01-12 12:33 ssh_employee\build\
目录 0 2017-01-12 12:33 ssh_employee\build\classes\
文件 3669 2016-12-24 22:52 ssh_employee\build\classes\applicationContext.xm
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\employee\
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\employee\action\
文件 2565 2017-01-11 18:39 ssh_employee\build\classes\com\employee\action\DepartmentAction.class
文件 3602 2017-01-11 22:15 ssh_employee\build\classes\com\employee\action\EmployeeAction.class
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\employee\dao\
文件 535 2017-01-12 12:18 ssh_employee\build\classes\com\employee\dao\DepartmentDao.class
文件 505 2017-01-12 12:17 ssh_employee\build\classes\com\employee\dao\EmployeeDao.class
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\employee\dao\impl\
文件 2674 2017-01-11 18:39 ssh_employee\build\classes\com\employee\dao\impl\DepartmentDaoImpl.class
文件 2899 2017-01-11 18:39 ssh_employee\build\classes\com\employee\dao\impl\EmployeeDaoImpl.class
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\employee\domain\
文件 1517 2017-01-11 21:03 ssh_employee\build\classes\com\employee\domain\Department.class
文件 719 2017-01-11 21:37 ssh_employee\build\classes\com\employee\domain\Department.hbm.xm
文件 2295 2017-01-12 12:25 ssh_employee\build\classes\com\employee\domain\Employee.class
文件 983 2017-01-11 21:45 ssh_employee\build\classes\com\employee\domain\Employee.hbm.xm
文件 1830 2017-01-11 18:39 ssh_employee\build\classes\com\employee\domain\PageBean.class
目录 0 2017-01-12 12:33 ssh_employee\build\classes\com\employee\service\
............此处省略170个文件信息
- 上一篇:立体匹配很详细的PPT
- 下一篇:SCJP试题详析SCJP试题详析
评论
共有 条评论