HibernateBaseDAO.java
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.espeed.yxy.dao;
import java.io.Serializable;
import java.util.List;
/**
* 程序名称: EspeedMail_时速邮箱
* 程序版本: V1.0
* 作 者: 深圳市科飞时速网络技术有限公司(0755-88843776)
* 版权所有: 深圳市科飞时速网络技术有限公司
* 技术支持: Tech@21gmail.com
* 单元名称: hbernate常用方法接口(营销邮)
* 开始时间: 2013.11.27
* 程 序 员: 谢勇
* 最后修改:
* 备 注: 如需修改请通知程序员
*/
public interface HibernateBaseDAO<T extends Serializable ,Pk extends Serializable> {
/**增加记录*/
int add(T o)throws Exception;
/**修改记录*/
void update(T o)throws Exception;
/**删除记录*/
void del(T o)throws Exception;
/**添加或更新*/
void saveOrUpdate(T o)throws Exception;
/**根据ID获取一条数据*/
T get(Class<T> t,Pk pk)throws Exception;
/**根据ID获取一条数据*/
T load(Class<T> t,Pk pk)throws Exception;
/**根据hql进行条件查询*/
List<T> getAll(String hql)throws Exception;
/**条件查询*/
List<T> getAll(String whereHql,Object...params)throws Exception;
//-------------------------------查询总记录数-----------------------------------------*/
/**根据条件查询总记录*/
public int count(String hql) throws Exception;
/**根据条件和参数查询总记录*/
public int count(String hql, Object... params) throws Exception;
}