LeavesServiceImpl.java
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:1k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. package org.yufeng.service.serviceImpl;
  2. import java.util.List;
  3. import org.yufeng.dao.ILeavesDao;
  4. import org.yufeng.domains.Leaves;
  5. import org.yufeng.service.ILeavesServiceDao;
  6. import org.yufeng.utils.AppContext;
  7. public class LeavesServiceImpl implements ILeavesServiceDao {
  8. ILeavesDao leavesDao;
  9. public ILeavesDao getLeavesDao() {
  10. return leavesDao;
  11. }
  12. public void setLeavesDao(ILeavesDao leavesDao) {
  13. this.leavesDao = leavesDao;
  14. }
  15. public boolean addLeaves(Leaves leaves) {
  16. return this.getLeavesDao().addLeaves(leaves);
  17. }
  18. public List browseALeaves() {
  19. return this.getLeavesDao().browseALeaves();
  20. }
  21. public boolean delLeaves(Leaves leaves) {
  22. return this.getLeavesDao().delLeaves(leaves);
  23. }
  24. public Leaves loadLeaves(Integer id) {
  25. return this.getLeavesDao().loadLeaves(id);
  26. }
  27. public boolean updateLeaves(Leaves leaves) {
  28. return this.getLeavesDao().updateLeaves(leaves);
  29. }
  30. public static void main(String[] args) {
  31. ILeavesServiceDao test = (ILeavesServiceDao) AppContext.getInstance()
  32. .getAppContext().getBean("leavesTarget");
  33. System.out.println(test);
  34. try {
  35. Leaves leaves = new Leaves();
  36. leaves.setLe_id(12);
  37. boolean flag = test.delLeaves(leaves);
  38. // System.out.println("size is "+size);
  39. } catch (Exception e) {
  40. // TODO Auto-generated catch block
  41. e.printStackTrace();
  42. }
  43. }
  44. }