@@ -25,229 +25,229 @@ public interface EmployeeDao {
25
25
26
26
@ Sql (
27
27
"""
28
- SELECT /*%expand*/*
29
- FROM employee
30
- WHERE id = /* id */0
31
- """ )
28
+ SELECT /*%expand*/*
29
+ FROM employee
30
+ WHERE id = /* id */0
31
+ """ )
32
32
@ Select
33
33
Employee selectById (Integer id );
34
34
35
35
@ Sql (
36
36
"""
37
- SELECT /*%expand*/*
38
- FROM employee
39
- WHERE
40
- /*%if min != null */
41
- age >= /* min */10
42
- /*%end */
43
- /*%if max != null */
44
- AND age <= /* max */70
45
- /*%end */
46
- ORDER BY age
47
- """ )
37
+ SELECT /*%expand*/*
38
+ FROM employee
39
+ WHERE
40
+ /*%if min != null */
41
+ age >= /* min */10
42
+ /*%end */
43
+ /*%if max != null */
44
+ AND age <= /* max */70
45
+ /*%end */
46
+ ORDER BY age
47
+ """ )
48
48
@ Select
49
49
List <Employee > selectByAgeRange (Age min , Age max );
50
50
51
51
@ Sql (
52
52
"""
53
- SELECT /*%expand*/*
54
- FROM employee
55
- WHERE
56
- /*%for age : ages */
57
- age = /* age */30
58
- /*%if age_has_next */
59
- /*# "or" */
60
- /*%end */
61
- /*%end */
62
- """ )
53
+ SELECT /*%expand*/*
54
+ FROM employee
55
+ WHERE
56
+ /*%for age : ages */
57
+ age = /* age */30
58
+ /*%if age_has_next */
59
+ /*# "or" */
60
+ /*%end */
61
+ /*%end */
62
+ """ )
63
63
@ Select
64
64
List <Employee > selectByAges (List <Age > ages );
65
65
66
66
@ Sql (
67
67
"""
68
- SELECT /*%expand*/*
69
- FROM employee
70
- WHERE
71
- /*%if name != null*/
72
- name = /* name */'hoge'
73
- /*%else */
74
- AND name IS NULL
75
- /*%end */
76
- """ )
68
+ SELECT /*%expand*/*
69
+ FROM employee
70
+ WHERE
71
+ /*%if name != null*/
72
+ name = /* name */'hoge'
73
+ /*%else */
74
+ AND name IS NULL
75
+ /*%end */
76
+ """ )
77
77
@ Select
78
78
List <Employee > selectByName (String name );
79
79
80
80
@ Sql (
81
81
"""
82
- SELECT /*%expand*/*
83
- FROM employee
84
- WHERE name IN /* names */('aaa', 'bbb')
85
- """ )
82
+ SELECT /*%expand*/*
83
+ FROM employee
84
+ WHERE name IN /* names */('aaa', 'bbb')
85
+ """ )
86
86
@ Select
87
87
List <Employee > selectByNames (List <String > names );
88
88
89
89
@ Sql (
90
90
"""
91
- SELECT /*%expand*/*
92
- FROM employee
93
- WHERE
94
- /*%if @isNotEmpty(name) */
95
- name = /* name */'hoge'
96
- /*%end*/
97
- """ )
91
+ SELECT /*%expand*/*
92
+ FROM employee
93
+ WHERE
94
+ /*%if @isNotEmpty(name) */
95
+ name = /* name */'hoge'
96
+ /*%end*/
97
+ """ )
98
98
@ Select
99
99
List <Employee > selectByNotEmptyName (String name );
100
100
101
101
@ Sql (
102
102
"""
103
- SELECT /*%expand*/*
104
- FROM employee
105
- WHERE name LIKE /* @prefix(prefix) */'X%' escape '$'
106
- """ )
103
+ SELECT /*%expand*/*
104
+ FROM employee
105
+ WHERE name LIKE /* @prefix(prefix) */'X%' escape '$'
106
+ """ )
107
107
@ Select
108
108
List <Employee > selectByNameWithPrefixMatching (String prefix );
109
109
110
110
@ Sql (
111
111
"""
112
- SELECT /*%expand*/*
113
- FROM employee
114
- WHERE name LIKE /* @suffix(suffix) */'%X' escape '$'
115
- """ )
112
+ SELECT /*%expand*/*
113
+ FROM employee
114
+ WHERE name LIKE /* @suffix(suffix) */'%X' escape '$'
115
+ """ )
116
116
@ Select
117
117
List <Employee > selectByNameWithSuffixMatching (String suffix );
118
118
119
119
@ Sql (
120
120
"""
121
- SELECT /*%expand*/*
122
- FROM employee
123
- WHERE name LIKE /* @infix(inside) */'%X%' escape '$'
124
- """ )
121
+ SELECT /*%expand*/*
122
+ FROM employee
123
+ WHERE name LIKE /* @infix(inside) */'%X%' escape '$'
124
+ """ )
125
125
@ Select
126
126
List <Employee > selectByNameWithInfixMatching (String inside );
127
127
128
128
@ Sql (
129
129
"""
130
- SELECT /*%expand*/*
131
- FROM employee
132
- WHERE hiredate >= /* @roundDownTimePart(from) */'2001-01-01 12:34:56'
133
- AND hiredate < /* @roundUpTimePart(to) */'2001-01-01 12:34:56'
134
- """ )
130
+ SELECT /*%expand*/*
131
+ FROM employee
132
+ WHERE hiredate >= /* @roundDownTimePart(from) */'2001-01-01 12:34:56'
133
+ AND hiredate < /* @roundUpTimePart(to) */'2001-01-01 12:34:56'
134
+ """ )
135
135
@ Select
136
136
List <Employee > selectByHiredateRange (Timestamp from , Timestamp to );
137
137
138
138
@ Sql (
139
139
"""
140
- SELECT /*%expand*/*
141
- FROM employee
142
- WHERE salary > /* salary */0
143
- """ )
140
+ SELECT /*%expand*/*
141
+ FROM employee
142
+ WHERE salary > /* salary */0
143
+ """ )
144
144
@ Select
145
145
List <Employee > selectBySalary (Salary salary );
146
146
147
147
@ Sql (
148
148
"""
149
- SELECT sum(salary)
150
- FROM employee
151
- """ )
149
+ SELECT sum(salary)
150
+ FROM employee
151
+ """ )
152
152
@ Select
153
153
Salary selectSummedSalary ();
154
154
155
155
@ Sql (
156
156
"""
157
- SELECT /*%expand*/*
158
- FROM employee
159
- WHERE name = /* e.name */'aaa'
160
- """ )
157
+ SELECT /*%expand*/*
158
+ FROM employee
159
+ WHERE name = /* e.name */'aaa'
160
+ """ )
161
161
@ Select
162
162
List <Employee > selectByExample (Employee e );
163
163
164
164
@ Sql (
165
165
"""
166
- SELECT /*%expand*/*
167
- FROM employee
168
- ORDER BY id
169
- """ )
166
+ SELECT /*%expand*/*
167
+ FROM employee
168
+ ORDER BY id
169
+ """ )
170
170
@ Select
171
171
List <Employee > selectAll ();
172
172
173
173
@ Sql (
174
174
"""
175
- SELECT /*%expand*/*
176
- FROM employee
177
- ORDER BY id
178
- """ )
175
+ SELECT /*%expand*/*
176
+ FROM employee
177
+ ORDER BY id
178
+ """ )
179
179
@ Select
180
180
List <Employee > selectAll (SelectOptions options );
181
181
182
182
@ Sql (
183
183
"""
184
- SELECT /*%expand*/*
185
- FROM employee
186
- WHERE age > /* age */0
187
- ORDER BY age
188
- """ )
184
+ SELECT /*%expand*/*
185
+ FROM employee
186
+ WHERE age > /* age */0
187
+ ORDER BY age
188
+ """ )
189
189
@ Select (strategy = SelectType .STREAM )
190
190
<R > R selectByAge (int age , Function <Stream <Employee >, R > mapper );
191
191
192
192
@ Sql (
193
193
"""
194
- SELECT /*%expand */*
195
- FROM employee e
196
- LEFT OUTER JOIN department d
197
- ON e.department_id = d.id
198
- ORDER BY e.id
199
- """ )
194
+ SELECT /*%expand */*
195
+ FROM employee e
196
+ LEFT OUTER JOIN department d
197
+ ON e.department_id = d.id
198
+ ORDER BY e.id
199
+ """ )
200
200
@ Select (aggregateStrategy = EmployeeAggregateStrategy .class )
201
201
List <Employee > selectAllEmployeeDepartment ();
202
202
203
203
@ Sql (
204
204
"""
205
- INSERT INTO Employee
206
- (ID
207
- , NAME
208
- , AGE
209
- , DEPARTMENT_ID
210
- , HIREDATE
211
- , JOB_TYPE
212
- , SALARY
213
- , INSERT_TIMESTAMP
214
- , UPDATE_TIMESTAMP
215
- , VERSION)
216
- VALUES ( /* employee.id */1
217
- , /* employee.name */'test'
218
- , /* employee.age */10
219
- , /* employee.departmentId */1
220
- , /* employee.hiredate */'2010-01-01'
221
- , /* employee.jobType */'SALESMAN'
222
- , /* employee.salary */300
223
- , /* employee.insertTimestamp */'2010-01-01 12:34:56'
224
- , /* employee.updateTimestamp */'2010-01-01 12:34:56'
225
- , /* employee.version */1 )
226
- """ )
205
+ INSERT INTO Employee
206
+ (ID
207
+ , NAME
208
+ , AGE
209
+ , DEPARTMENT_ID
210
+ , HIREDATE
211
+ , JOB_TYPE
212
+ , SALARY
213
+ , INSERT_TIMESTAMP
214
+ , UPDATE_TIMESTAMP
215
+ , VERSION)
216
+ VALUES ( /* employee.id */1
217
+ , /* employee.name */'test'
218
+ , /* employee.age */10
219
+ , /* employee.departmentId */1
220
+ , /* employee.hiredate */'2010-01-01'
221
+ , /* employee.jobType */'SALESMAN'
222
+ , /* employee.salary */300
223
+ , /* employee.insertTimestamp */'2010-01-01 12:34:56'
224
+ , /* employee.updateTimestamp */'2010-01-01 12:34:56'
225
+ , /* employee.version */1 )
226
+ """ )
227
227
@ Insert
228
228
int insert (Employee employee );
229
229
230
230
@ Sql (
231
231
"""
232
- UPDATE Employee
233
- SET NAME = /* employee.name */'test'
234
- , AGE = /* employee.age */10
235
- , DEPARTMENT_ID = /* employee.departmentId */1
236
- , HIREDATE = /* employee.hiredate */'2010-01-01'
237
- , JOB_TYPE = /* employee.jobType */'SALESMAN'
238
- , SALARY = /* employee.salary */300
239
- , UPDATE_TIMESTAMP = /* employee.updateTimestamp */'2010-01-01 12:34:56'
240
- , VERSION = /* employee.version */1
241
- WHERE ID = /* employee.id */1
242
- """ )
232
+ UPDATE Employee
233
+ SET NAME = /* employee.name */'test'
234
+ , AGE = /* employee.age */10
235
+ , DEPARTMENT_ID = /* employee.departmentId */1
236
+ , HIREDATE = /* employee.hiredate */'2010-01-01'
237
+ , JOB_TYPE = /* employee.jobType */'SALESMAN'
238
+ , SALARY = /* employee.salary */300
239
+ , UPDATE_TIMESTAMP = /* employee.updateTimestamp */'2010-01-01 12:34:56'
240
+ , VERSION = /* employee.version */1
241
+ WHERE ID = /* employee.id */1
242
+ """ )
243
243
@ Update
244
244
int update (Employee employee );
245
245
246
246
@ Sql (
247
247
"""
248
- DELETE FROM Employee
249
- WHERE ID = /* employee.id */0
250
- """ )
248
+ DELETE FROM Employee
249
+ WHERE ID = /* employee.id */0
250
+ """ )
251
251
@ Delete
252
252
int delete (Employee employee );
253
253
}
0 commit comments