自定义通用DAO实现基本的CRUD,比如:
public interface BaseDao<T> {
int insert(T obj) throws Exception;
int update(T obj) throws Exception;
int deleteByPrimaryKey(Object key) throws Exception;
int selectCount() throws SQLException;
List<T> selectPage(Integer pageNum, Integer pageSize) throws SQLException;
T selectByPrimaryKey(Object key) throws SQLException;
}
评论0
最新资源