1 /**
2 * Copyright 2006-2016 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.mybatis.generator.api;
17
18 /**
19 * This interface is used to supply names for DAO methods. Users can provide
20 * different implementations if the supplied implementations aren't sufficient.
21 *
22 * @author Jeff Butler
23 *
24 */
25 public interface DAOMethodNameCalculator {
26
27 /**
28 * Calculates and returns a name for the insert method.
29 *
30 * @param introspectedTable
31 * the introspected table
32 * @return the calculated name
33 */
34 String getInsertMethodName(IntrospectedTable introspectedTable);
35
36 /**
37 * Calculates and returns a name for the insert selective method.
38 *
39 * @param introspectedTable
40 * the introspected table
41 * @return the calculated name
42 */
43 String getInsertSelectiveMethodName(IntrospectedTable introspectedTable);
44
45 /**
46 * Calculates and returns a name for the update by primary key without BLOBs method.
47 *
48 * @param introspectedTable
49 * the introspected table
50 * @return the calculated name
51 */
52 String getUpdateByPrimaryKeyWithoutBLOBsMethodName(
53 IntrospectedTable introspectedTable);
54
55 /**
56 * Calculates and returns a name for the update by primary key with BLOBs method.
57 *
58 * @param introspectedTable
59 * the introspected table
60 * @return the calculated name
61 */
62 String getUpdateByPrimaryKeyWithBLOBsMethodName(
63 IntrospectedTable introspectedTable);
64
65 /**
66 * Calculates and returns a name for the update by primary key selective method.
67 *
68 * @param introspectedTable
69 * the introspected table
70 * @return the calculated name
71 */
72 String getUpdateByPrimaryKeySelectiveMethodName(
73 IntrospectedTable introspectedTable);
74
75 /**
76 * Calculates and returns a name for the select by primary key method.
77 *
78 * @param introspectedTable
79 * the introspected table
80 * @return the calculated name
81 */
82 String getSelectByPrimaryKeyMethodName(IntrospectedTable introspectedTable);
83
84 /**
85 * Calculates and returns a name for the select by example method.
86 *
87 * @param introspectedTable
88 * the introspected table
89 * @return the calculated name
90 */
91 String getSelectByExampleWithoutBLOBsMethodName(
92 IntrospectedTable introspectedTable);
93
94 /**
95 * Calculates and returns a name for the select by example with BLOBs method. If the table contains BLOBs, then we
96 * will generate different select by example methods - one including BLOBs, one not including BLOBs.
97 *
98 * @param introspectedTable
99 * the introspected table
100 * @return the calculated name
101 */
102 String getSelectByExampleWithBLOBsMethodName(
103 IntrospectedTable introspectedTable);
104
105 /**
106 * Calculates and returns a name for the delete by primary key method.
107 *
108 * @param introspectedTable
109 * the introspected table
110 * @return the calculated name
111 */
112 String getDeleteByPrimaryKeyMethodName(IntrospectedTable introspectedTable);
113
114 /**
115 * Calculates and returns a name for the delete by example method.
116 *
117 * @param introspectedTable
118 * the introspected table
119 * @return the calculated name
120 */
121 String getDeleteByExampleMethodName(IntrospectedTable introspectedTable);
122
123 /**
124 * Calculates and returns a name for the count by example method.
125 *
126 * @param introspectedTable
127 * the introspected table
128 * @return the calculated name
129 */
130 String getCountByExampleMethodName(IntrospectedTable introspectedTable);
131
132 /**
133 * Calculates and returns a name for the update by example selective method.
134 *
135 * @param introspectedTable
136 * the introspected table
137 * @return the calculated name
138 */
139 String getUpdateByExampleSelectiveMethodName(
140 IntrospectedTable introspectedTable);
141
142 /**
143 * Calculates and returns a name for the update by example with BLOBs method.
144 *
145 * @param introspectedTable
146 * the introspected table
147 * @return the calculated name
148 */
149 String getUpdateByExampleWithBLOBsMethodName(
150 IntrospectedTable introspectedTable);
151
152 /**
153 * Calculates and returns a name for the update by example without BLOBs method.
154 *
155 * @param introspectedTable
156 * the introspected table
157 * @return the calculated name
158 */
159 String getUpdateByExampleWithoutBLOBsMethodName(
160 IntrospectedTable introspectedTable);
161 }