1 package org.guangsoft.dao;
2
3 import java.util.List;
4 import java.util.Set;
5 /**
6 * 公共DAO功能
7 * @param <K>要操作的主键类型,由子接口实现
8 * @param <V> 要操作的POJO类型,由子接口实现
9 * @author guanghe
10 */
11 public interface CommDao<K,V>
12 {
13 //增加数据
14 public Boolean doCreate(V pojo) throws Exception;
15 //删除数据
16 public Boolean doDelete(V pojo) throws Exception;
17 //修改数据
18 public Boolean doUpdate(V pojo) throws Exception;
19 //查询所有数据
20 public List<V> findAll() throws Exception;
21 //根据id获取数据
22 public V findById(K id) throws Exception;
23 //根据name获取数据
24 public V findByName(String name) throws Exception;
25 //根据id批量删除数据
26 public Boolean doRemoveBatch(Set<K> ids) throws Exception;
27 //
28 public Integer getAllCount(String column,String keyWord) throws Exception;
29 //分页查询数据
30 public List<V> findAllSplit(Integer currentPage,Integer lineSize,String column,String keyWord) throws Exception;
31 }