7
7
import org .apache .commons .lang .StringUtils ;
8
8
import org .apache .ibatis .annotations .Param ;
9
9
10
+ import java .lang .reflect .InvocationTargetException ;
10
11
import java .lang .reflect .Method ;
11
12
import java .lang .reflect .ParameterizedType ;
12
13
import java .util .List ;
@@ -26,7 +27,11 @@ public int countByExample(Example example) {
26
27
Method countByExample = mapper .getClass ().getDeclaredMethod ("countByExample" , example .getClass ());
27
28
Object result = countByExample .invoke (mapper , example );
28
29
return Integer .parseInt (String .valueOf (result ));
29
- } catch (Exception e ) {
30
+ } catch (IllegalAccessException e ) {
31
+ e .printStackTrace ();
32
+ } catch (InvocationTargetException e ) {
33
+ e .printStackTrace ();
34
+ } catch (NoSuchMethodException e ) {
30
35
e .printStackTrace ();
31
36
}
32
37
DynamicDataSource .clearDataSource ();
@@ -40,7 +45,11 @@ public int deleteByExample(Example example) {
40
45
Method deleteByExample = mapper .getClass ().getDeclaredMethod ("deleteByExample" , example .getClass ());
41
46
Object result = deleteByExample .invoke (mapper , example );
42
47
return Integer .parseInt (String .valueOf (result ));
43
- } catch (Exception e ) {
48
+ } catch (IllegalAccessException e ) {
49
+ e .printStackTrace ();
50
+ } catch (InvocationTargetException e ) {
51
+ e .printStackTrace ();
52
+ } catch (NoSuchMethodException e ) {
44
53
e .printStackTrace ();
45
54
}
46
55
DynamicDataSource .clearDataSource ();
@@ -54,7 +63,11 @@ public int deleteByPrimaryKey(Integer id) {
54
63
Method deleteByPrimaryKey = mapper .getClass ().getDeclaredMethod ("deleteByPrimaryKey" , id .getClass ());
55
64
Object result = deleteByPrimaryKey .invoke (mapper , id );
56
65
return Integer .parseInt (String .valueOf (result ));
57
- } catch (Exception e ) {
66
+ } catch (IllegalAccessException e ) {
67
+ e .printStackTrace ();
68
+ } catch (InvocationTargetException e ) {
69
+ e .printStackTrace ();
70
+ } catch (NoSuchMethodException e ) {
58
71
e .printStackTrace ();
59
72
}
60
73
DynamicDataSource .clearDataSource ();
@@ -68,7 +81,11 @@ public int insert(Record record) {
68
81
Method insert = mapper .getClass ().getDeclaredMethod ("insert" , record .getClass ());
69
82
Object result = insert .invoke (mapper , record );
70
83
return Integer .parseInt (String .valueOf (result ));
71
- } catch (Exception e ) {
84
+ } catch (IllegalAccessException e ) {
85
+ e .printStackTrace ();
86
+ } catch (InvocationTargetException e ) {
87
+ e .printStackTrace ();
88
+ } catch (NoSuchMethodException e ) {
72
89
e .printStackTrace ();
73
90
}
74
91
DynamicDataSource .clearDataSource ();
@@ -82,7 +99,11 @@ public int insertSelective(Record record) {
82
99
Method insertSelective = mapper .getClass ().getDeclaredMethod ("insertSelective" , record .getClass ());
83
100
Object result = insertSelective .invoke (mapper , record );
84
101
return Integer .parseInt (String .valueOf (result ));
85
- } catch (Exception e ) {
102
+ } catch (IllegalAccessException e ) {
103
+ e .printStackTrace ();
104
+ } catch (InvocationTargetException e ) {
105
+ e .printStackTrace ();
106
+ } catch (NoSuchMethodException e ) {
86
107
e .printStackTrace ();
87
108
}
88
109
DynamicDataSource .clearDataSource ();
@@ -96,7 +117,11 @@ public List<Record> selectByExampleWithBLOBs(Example example) {
96
117
Method selectByExampleWithBLOBs = mapper .getClass ().getDeclaredMethod ("selectByExampleWithBLOBs" , example .getClass ());
97
118
Object result = selectByExampleWithBLOBs .invoke (mapper , example );
98
119
return (List <Record >) result ;
99
- } catch (Exception e ) {
120
+ } catch (IllegalAccessException e ) {
121
+ e .printStackTrace ();
122
+ } catch (InvocationTargetException e ) {
123
+ e .printStackTrace ();
124
+ } catch (NoSuchMethodException e ) {
100
125
e .printStackTrace ();
101
126
}
102
127
DynamicDataSource .clearDataSource ();
@@ -110,7 +135,11 @@ public List<Record> selectByExample(Example example) {
110
135
Method selectByExample = mapper .getClass ().getDeclaredMethod ("selectByExample" , example .getClass ());
111
136
Object result = selectByExample .invoke (mapper , example );
112
137
return (List <Record >) result ;
113
- } catch (Exception e ) {
138
+ } catch (IllegalAccessException e ) {
139
+ e .printStackTrace ();
140
+ } catch (InvocationTargetException e ) {
141
+ e .printStackTrace ();
142
+ } catch (NoSuchMethodException e ) {
114
143
e .printStackTrace ();
115
144
}
116
145
DynamicDataSource .clearDataSource ();
@@ -125,7 +154,11 @@ public List<Record> selectByExampleWithBLOBsForStartPage(Example example, Intege
125
154
PageHelper .startPage (pageNum , pageSize , false );
126
155
Object result = selectByExampleWithBLOBs .invoke (mapper , example );
127
156
return (List <Record >) result ;
128
- } catch (Exception e ) {
157
+ } catch (IllegalAccessException e ) {
158
+ e .printStackTrace ();
159
+ } catch (InvocationTargetException e ) {
160
+ e .printStackTrace ();
161
+ } catch (NoSuchMethodException e ) {
129
162
e .printStackTrace ();
130
163
}
131
164
DynamicDataSource .clearDataSource ();
@@ -140,7 +173,11 @@ public List<Record> selectByExampleForStartPage(Example example, Integer pageNum
140
173
PageHelper .startPage (pageNum , pageSize , false );
141
174
Object result = selectByExample .invoke (mapper , example );
142
175
return (List <Record >) result ;
143
- } catch (Exception e ) {
176
+ } catch (IllegalAccessException e ) {
177
+ e .printStackTrace ();
178
+ } catch (InvocationTargetException e ) {
179
+ e .printStackTrace ();
180
+ } catch (NoSuchMethodException e ) {
144
181
e .printStackTrace ();
145
182
}
146
183
DynamicDataSource .clearDataSource ();
@@ -155,7 +192,11 @@ public List<Record> selectByExampleWithBLOBsForOffsetPage(Example example, Integ
155
192
PageHelper .offsetPage (offset , limit , false );
156
193
Object result = selectByExampleWithBLOBs .invoke (mapper , example );
157
194
return (List <Record >) result ;
158
- } catch (Exception e ) {
195
+ } catch (IllegalAccessException e ) {
196
+ e .printStackTrace ();
197
+ } catch (InvocationTargetException e ) {
198
+ e .printStackTrace ();
199
+ } catch (NoSuchMethodException e ) {
159
200
e .printStackTrace ();
160
201
}
161
202
DynamicDataSource .clearDataSource ();
@@ -170,7 +211,11 @@ public List<Record> selectByExampleForOffsetPage(Example example, Integer offset
170
211
PageHelper .offsetPage (offset , limit , false );
171
212
Object result = selectByExample .invoke (mapper , example );
172
213
return (List <Record >) result ;
173
- } catch (Exception e ) {
214
+ } catch (IllegalAccessException e ) {
215
+ e .printStackTrace ();
216
+ } catch (InvocationTargetException e ) {
217
+ e .printStackTrace ();
218
+ } catch (NoSuchMethodException e ) {
174
219
e .printStackTrace ();
175
220
}
176
221
DynamicDataSource .clearDataSource ();
@@ -186,7 +231,11 @@ public Record selectFirstByExample(Example example) {
186
231
if (null != result && result .size () > 0 ) {
187
232
return result .get (0 );
188
233
}
189
- } catch (Exception e ) {
234
+ } catch (IllegalAccessException e ) {
235
+ e .printStackTrace ();
236
+ } catch (InvocationTargetException e ) {
237
+ e .printStackTrace ();
238
+ } catch (NoSuchMethodException e ) {
190
239
e .printStackTrace ();
191
240
}
192
241
DynamicDataSource .clearDataSource ();
@@ -202,7 +251,11 @@ public Record selectFirstByExampleWithBLOBs(Example example) {
202
251
if (null != result && result .size () > 0 ) {
203
252
return result .get (0 );
204
253
}
205
- } catch (Exception e ) {
254
+ } catch (IllegalAccessException e ) {
255
+ e .printStackTrace ();
256
+ } catch (InvocationTargetException e ) {
257
+ e .printStackTrace ();
258
+ } catch (NoSuchMethodException e ) {
206
259
e .printStackTrace ();
207
260
}
208
261
DynamicDataSource .clearDataSource ();
@@ -216,7 +269,11 @@ public Record selectByPrimaryKey(Integer id) {
216
269
Method selectByPrimaryKey = mapper .getClass ().getDeclaredMethod ("selectByPrimaryKey" , id .getClass ());
217
270
Object result = selectByPrimaryKey .invoke (mapper , id );
218
271
return (Record ) result ;
219
- } catch (Exception e ) {
272
+ } catch (IllegalAccessException e ) {
273
+ e .printStackTrace ();
274
+ } catch (InvocationTargetException e ) {
275
+ e .printStackTrace ();
276
+ } catch (NoSuchMethodException e ) {
220
277
e .printStackTrace ();
221
278
}
222
279
DynamicDataSource .clearDataSource ();
@@ -230,7 +287,11 @@ public int updateByExampleSelective(@Param("record") Record record, @Param("exam
230
287
Method updateByExampleSelective = mapper .getClass ().getDeclaredMethod ("updateByExampleSelective" , record .getClass (), example .getClass ());
231
288
Object result = updateByExampleSelective .invoke (mapper , record , example );
232
289
return Integer .parseInt (String .valueOf (result ));
233
- } catch (Exception e ) {
290
+ } catch (IllegalAccessException e ) {
291
+ e .printStackTrace ();
292
+ } catch (InvocationTargetException e ) {
293
+ e .printStackTrace ();
294
+ } catch (NoSuchMethodException e ) {
234
295
e .printStackTrace ();
235
296
}
236
297
DynamicDataSource .clearDataSource ();
@@ -244,7 +305,11 @@ public int updateByExampleWithBLOBs(@Param("record") Record record, @Param("exam
244
305
Method updateByExampleWithBLOBs = mapper .getClass ().getDeclaredMethod ("updateByExampleWithBLOBs" , record .getClass (), example .getClass ());
245
306
Object result = updateByExampleWithBLOBs .invoke (mapper , record , example );
246
307
return Integer .parseInt (String .valueOf (result ));
247
- } catch (Exception e ) {
308
+ } catch (IllegalAccessException e ) {
309
+ e .printStackTrace ();
310
+ } catch (InvocationTargetException e ) {
311
+ e .printStackTrace ();
312
+ } catch (NoSuchMethodException e ) {
248
313
e .printStackTrace ();
249
314
}
250
315
DynamicDataSource .clearDataSource ();
@@ -258,7 +323,11 @@ public int updateByExample(@Param("record") Record record, @Param("example") Exa
258
323
Method updateByExample = mapper .getClass ().getDeclaredMethod ("updateByExample" , record .getClass (), example .getClass ());
259
324
Object result = updateByExample .invoke (mapper , record , example );
260
325
return Integer .parseInt (String .valueOf (result ));
261
- } catch (Exception e ) {
326
+ } catch (IllegalAccessException e ) {
327
+ e .printStackTrace ();
328
+ } catch (InvocationTargetException e ) {
329
+ e .printStackTrace ();
330
+ } catch (NoSuchMethodException e ) {
262
331
e .printStackTrace ();
263
332
}
264
333
DynamicDataSource .clearDataSource ();
@@ -272,7 +341,11 @@ public int updateByPrimaryKeySelective(Record record) {
272
341
Method updateByPrimaryKeySelective = mapper .getClass ().getDeclaredMethod ("updateByPrimaryKeySelective" , record .getClass ());
273
342
Object result = updateByPrimaryKeySelective .invoke (mapper , record );
274
343
return Integer .parseInt (String .valueOf (result ));
275
- } catch (Exception e ) {
344
+ } catch (IllegalAccessException e ) {
345
+ e .printStackTrace ();
346
+ } catch (InvocationTargetException e ) {
347
+ e .printStackTrace ();
348
+ } catch (NoSuchMethodException e ) {
276
349
e .printStackTrace ();
277
350
}
278
351
DynamicDataSource .clearDataSource ();
@@ -286,7 +359,11 @@ public int updateByPrimaryKeyWithBLOBs(Record record) {
286
359
Method updateByPrimaryKeyWithBLOBs = mapper .getClass ().getDeclaredMethod ("updateByPrimaryKeyWithBLOBs" , record .getClass ());
287
360
Object result = updateByPrimaryKeyWithBLOBs .invoke (mapper , record );
288
361
return Integer .parseInt (String .valueOf (result ));
289
- } catch (Exception e ) {
362
+ } catch (IllegalAccessException e ) {
363
+ e .printStackTrace ();
364
+ } catch (InvocationTargetException e ) {
365
+ e .printStackTrace ();
366
+ } catch (NoSuchMethodException e ) {
290
367
e .printStackTrace ();
291
368
}
292
369
DynamicDataSource .clearDataSource ();
@@ -300,7 +377,11 @@ public int updateByPrimaryKey(Record record) {
300
377
Method updateByPrimaryKey = mapper .getClass ().getDeclaredMethod ("updateByPrimaryKey" , record .getClass ());
301
378
Object result = updateByPrimaryKey .invoke (mapper , record );
302
379
return Integer .parseInt (String .valueOf (result ));
303
- } catch (Exception e ) {
380
+ } catch (IllegalAccessException e ) {
381
+ e .printStackTrace ();
382
+ } catch (InvocationTargetException e ) {
383
+ e .printStackTrace ();
384
+ } catch (NoSuchMethodException e ) {
304
385
e .printStackTrace ();
305
386
}
306
387
DynamicDataSource .clearDataSource ();
@@ -326,7 +407,11 @@ public int deleteByPrimaryKeys(String ids) {
326
407
count += Integer .parseInt (String .valueOf (result ));
327
408
}
328
409
return count ;
329
- } catch (Exception e ) {
410
+ } catch (IllegalAccessException e ) {
411
+ e .printStackTrace ();
412
+ } catch (InvocationTargetException e ) {
413
+ e .printStackTrace ();
414
+ } catch (NoSuchMethodException e ) {
330
415
e .printStackTrace ();
331
416
}
332
417
DynamicDataSource .clearDataSource ();
0 commit comments