美文网首页JavaWeb
SubList分页-013-SubListStudentServ

SubList分页-013-SubListStudentServ

作者: 53b3f4658edc | 来源:发表于2017-11-08 10:20 被阅读1次

1.实现接口StudentService,返回Pager<Student>
2.添加成员:SubListStudentDAOImpl对象

package top.itcourse.page.service;

import top.itcourse.page.dao.StudentDAO;
import top.itcourse.page.dao.SubListStudentDAOImpl;
import top.itcourse.page.model.Pager;
import top.itcourse.page.model.Student;

/*
 * SubListStudentServiceImpl类:
 *  1.实现接口StudentService,返回Pager<Student>
 *  2.添加成员:SubListStudentDAOImpl对象
 */
public class SubListStudentServiceImpl implements StudentService {

    private StudentDAO studentDAO;  
    
    public SubListStudentServiceImpl() {
        // 初始化studentDAO
        studentDAO = new SubListStudentDAOImpl();
    }
    
    @Override
    public Pager<Student> findStudent(Student searchModel, int currentPage, int pageSize) {
//      System.out.println("currentPage: " + currentPage);  
        // 获取查询到的Pager<Student>
        Pager<Student> result = studentDAO.findStudent(searchModel, currentPage, pageSize);
        
        return result;
    }
    
    public StudentDAO getStudentDAO() {
        return studentDAO;
    }

    public void setStudentDAO(StudentDAO studentDAO) {
        this.studentDAO = studentDAO;
    }
}

源码下载

关注下方的微信公众号,回复:java_div_page.code





欢迎加入交流群:451826376


更多信息:www.itcourse.top

完整教程PDF版本下载

相关文章

网友评论

    本文标题:SubList分页-013-SubListStudentServ

    本文链接:https://www.haomeiwen.com/subject/akjemxtx.html