web开发dao层通用接口

接口

public interface IDao<E> {
    public List<E> findAll();
    
    public E findById(Integer id);
    
    public void deleteById(Integer id);
    
    public void update(E entity);
    
    public List<E> pageList(Integer start,Integer end);
}

实现类

public class EmployeeDao implements IDao<Employee> {
    public Connection conn = JdbcUtils.getConn();

    @Override
    public List<Employee> findAll() {...}

    @Override
    public Employee findById(Integer id) {...}

    @Override
    public void deleteById(Integer id) {...}

    @Override
    public void update(Employee entity) {...}

    @Override
    public List<Employee> pageList(Integer start, Integer end) {...}

}

 

posted @ 2019-10-15 19:51  Luo丶D  阅读(362)  评论(0编辑  收藏  举报