TeacherServiceImp.java
上传用户:nbxinmin
上传日期:2021-10-09
资源大小:46k
文件大小:1k
源码类别:

Internet/IE编程

开发平台:

Java

  1. package com.xdf.exams.bo.service;
  2. import java.util.List;
  3. import com.xdf.exams.bean.Teacher;
  4. import com.xdf.exams.bo.ITeacherService;
  5. import com.xdf.exams.dao.ITeacherDAO;
  6. public class TeacherServiceImp extends BaseService implements ITeacherService{
  7. private ITeacherDAO teacherdao = null;
  8. public ITeacherDAO getTeacherdao() {
  9. return teacherdao;
  10. }
  11. public void setTeacherdao(ITeacherDAO teacherdao) {
  12. this.teacherdao = teacherdao;
  13. }
  14. public void addTeacher(Teacher s) {
  15. beginTransaction();
  16. teacherdao.add(s);
  17. commitTransaction();
  18. }
  19. public void deleteTeacher(Teacher s) {
  20. beginTransaction();
  21. teacherdao.delete(s);
  22. commitTransaction();
  23. }
  24. public List findAllTeacher() {
  25. return teacherdao.findAllTeacher();
  26. }
  27. public List findAllTeacher(int pageno, int pagesize) {
  28. return teacherdao.findAllTeacher(pageno,pagesize);
  29. }
  30. public Teacher findTeacher(Long id) {
  31. return (Teacher)teacherdao.load(Teacher.class,id);
  32. }
  33. public int findTeachernum() {
  34. return teacherdao.findTeachernum();
  35. }
  36. public void updateTeacher(Teacher s) {
  37. beginTransaction();
  38. teacherdao.update(s);
  39. commitTransaction();
  40. }
  41. }