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 }