123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- package com.post.dao;
- import java.io.Serializable;
- import java.util.List;
- import java.util.Map;
- public interface BaseDaoI<T> {
- public Serializable save(T o);
- /**
- * 删除一个对象
- *
- * @param o
- */
- public void delete(T o);
- /**
- * 更新一个对象
- *
- * @param o
- */
- public void update(T o);
- /**
- * 保存或更新对象
- *
- * @param o
- */
- public void saveOrUpdate(T o);
- /**
- * 查询
- *
- * @param hql
- * @return
- */
- public List<T> find(String hql);
- /**
- * 查询集合
- *
- * @param hql
- * @param param
- * @return
- */
- public List<T> find(String hql, Map<String, Object> params);
- /**
- * 查询集合
- *
- * @param hql
- * @param param
- * @return
- */
- public List<T> find(String hql, List<Object> param);
- /**
- * 查询集合(带分页)
- *
- * @param hql
- * @param param
- * @param page
- * 查询第几页
- * @param rows
- * 每页显示几条记录
- * @return
- */
- public List<T> find(String hql, Map<String, Object> params, Integer page, Integer rows);
- /**
- * 查询集合(带分页)
- *
- * @param hql
- * @param param
- * @param page
- * @param rows
- * @return
- */
- public List<T> find(String hql, List<Object> param, Integer page, Integer rows);
- public List<T> find(String hql, Integer page, Integer rows);
- /**
- * 获得一个对象
- *
- * @param c
- * 对象类型
- * @param id
- * @return Object
- */
- public T get(Class<T> c, Serializable id);
- /**
- * 获得一个对象
- *
- * @param hql
- * @param param
- * @return Object
- */
- public T get(String hql, List<Object> param);
- /**
- * select count(*) from 类
- *
- * @param hql
- * @return
- */
- public T get(String hql, Map<String, Object> params);
- public Long count(String hql);
- /**
- * select count(*) from 类
- *
- * @param hql
- * @param param
- * @return
- */
- public Long count(String hql, Map<String, Object> params);
- /**
- * select count(*) from 类
- *
- * @param hql
- * @param param
- * @return
- */
- public Long count(String hql, List<Object> param);
- /**
- * 执行HQL语句
- *
- * @param hql
- * @return 响应数目
- */
- public Integer executeHql(String hql);
- /**
- * 执行HQL语句
- *
- * @param hql
- * @param param
- * @return 响应数目
- */
- public Integer executeHql(String hql, Map<String, Object> params);
- /**
- * 执行HQL语句
- *
- * @param hql
- * @param param
- * @return
- */
- public Integer executeHql(String hql, List<Object> param);
- public Double sum(String hql);
- public Double sum(String hql, Map<String, Object> params);
- public Object[] summ(String hql, Map<String, Object> params);
- }
|