-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathBaseOperation.java
More file actions
86 lines (70 loc) · 1.96 KB
/
BaseOperation.java
File metadata and controls
86 lines (70 loc) · 1.96 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package club.fangkeng.bbs.base;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import java.io.Serializable;
/**
* Created by KevinBlandy on 2017/4/26 11:56
*/
public interface BaseOperation <T extends BaseEntity>{
/* --------------------- select --------------------- */
/**
* 根据pk检索一条记录
* @param primaryKey
* @return
* @throws Exception
*/
T queryByPrimaryKey(Serializable primaryKey)throws Exception;
/**
* 根据非空参数检索记录
* @param entity
* @param pageBounds
* @return
* @throws Exception
*/
PageList<T> queryByParamSelective(T entity, PageBounds pageBounds)throws Exception;
/**
* 根据非空参数仅仅检索出一条记录
* @param entity
* @return
* @throws Exception
*/
T queryByParamSelectiveSole(T entity)throws Exception;
/* --------------------- insert --------------------- */
/**
* 创建一条新的记录
* @param entity
* @return
* @throws Exception
*/
Integer create(T entity)throws Exception;
/* --------------------- update --------------------- */
/**
* 根据pk更新非空数据
* @param entity
* @return
* @throws Exception
*/
Integer updateByPrimaryKeySelective(T entity)throws Exception;
/**
* 根据pk更新数据
* @param entity
* @return
* @throws Exception
*/
Integer updateByPrimaryKey(T entity)throws Exception;
/* --------------------- delete --------------------- */
/**
* 根据pk删除记录
* @param primaryKey
* @return
* @throws Exception
*/
Integer deleteByPrimaryKey(Serializable primaryKey)throws Exception;
/**
* 根据非空参数删除记录
* @param entity
* @return
* @throws Exception
*/
Integer deleteByParamSelective(T entity)throws Exception;
}