1
|
|
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
package org.asyrinx.brownie.hibernate.logger;
|
9
|
|
|
10
|
|
import java.io.Serializable;
|
11
|
|
import java.math.BigDecimal;
|
12
|
|
import java.util.Calendar;
|
13
|
|
import java.util.Collection;
|
14
|
|
import java.util.Date;
|
15
|
|
import java.util.Iterator;
|
16
|
|
import java.util.List;
|
17
|
|
import java.util.Locale;
|
18
|
|
|
19
|
|
import net.sf.hibernate.HibernateException;
|
20
|
|
import net.sf.hibernate.LockMode;
|
21
|
|
import net.sf.hibernate.MappingException;
|
22
|
|
import net.sf.hibernate.Query;
|
23
|
|
import net.sf.hibernate.ScrollableResults;
|
24
|
|
import net.sf.hibernate.type.Type;
|
25
|
|
|
26
|
|
import org.asyrinx.brownie.core.log.CascadeNamedLog;
|
27
|
|
import org.asyrinx.brownie.hibernate.wrapper.QueryWrapper;
|
28
|
|
|
29
|
|
|
30
|
|
|
31
|
|
|
32
|
|
public class LogQuery extends QueryWrapper {
|
33
|
|
|
34
|
|
|
35
|
|
|
36
|
|
|
37
|
|
|
38
|
0
|
public LogQuery(Query wrapped, CascadeNamedLog parentLog) {
|
39
|
0
|
super(wrapped);
|
40
|
0
|
this.log = parentLog.subLog(wrapped);
|
41
|
|
}
|
42
|
|
|
43
|
|
protected final CascadeNamedLog log;
|
44
|
|
|
45
|
0
|
private Query toLogged(Query query) {
|
46
|
0
|
return new LogQuery(query, log);
|
47
|
|
}
|
48
|
|
|
49
|
|
|
50
|
|
|
51
|
|
|
52
|
0
|
public String[] getNamedParameters() throws HibernateException {
|
53
|
0
|
log.log("getNamedParameters()");
|
54
|
0
|
return super.getNamedParameters();
|
55
|
|
}
|
56
|
|
|
57
|
|
|
58
|
|
|
59
|
|
|
60
|
0
|
public String getQueryString() {
|
61
|
0
|
log.log("getQueryString()");
|
62
|
0
|
return super.getQueryString();
|
63
|
|
}
|
64
|
|
|
65
|
|
|
66
|
|
|
67
|
|
|
68
|
0
|
public Type[] getReturnTypes() throws HibernateException {
|
69
|
0
|
log.log("getReturnTypes()");
|
70
|
0
|
return super.getReturnTypes();
|
71
|
|
}
|
72
|
|
|
73
|
|
|
74
|
|
|
75
|
|
|
76
|
0
|
public Iterator iterate() throws HibernateException {
|
77
|
0
|
log.log("iterate()");
|
78
|
0
|
return super.iterate();
|
79
|
|
}
|
80
|
|
|
81
|
|
|
82
|
|
|
83
|
|
|
84
|
0
|
public List list() throws HibernateException {
|
85
|
0
|
log.log("list()");
|
86
|
0
|
return super.list();
|
87
|
|
}
|
88
|
|
|
89
|
|
|
90
|
|
|
91
|
|
|
92
|
0
|
public ScrollableResults scroll() throws HibernateException {
|
93
|
0
|
log.log("scroll()");
|
94
|
0
|
return new LogScrollableResults(super.scroll(), log);
|
95
|
|
}
|
96
|
|
|
97
|
|
|
98
|
|
|
99
|
|
|
100
|
0
|
public Query setBigDecimal(int position, BigDecimal number) {
|
101
|
0
|
log.log("setBigDecimal(" + position + ", " + number + ")");
|
102
|
0
|
return toLogged(super.setBigDecimal(position, number));
|
103
|
|
}
|
104
|
|
|
105
|
|
|
106
|
|
|
107
|
|
|
108
|
|
|
109
|
0
|
public Query setBigDecimal(String name, BigDecimal number) {
|
110
|
0
|
log.log("setBigDecimal(" + name + ", " + number + ")");
|
111
|
0
|
return toLogged(super.setBigDecimal(name, number));
|
112
|
|
}
|
113
|
|
|
114
|
|
|
115
|
|
|
116
|
|
|
117
|
0
|
public Query setBinary(int position, byte[] val) {
|
118
|
0
|
log.log("setBinary(" + position + ", " + val + ")");
|
119
|
0
|
return toLogged(super.setBinary(position, val));
|
120
|
|
}
|
121
|
|
|
122
|
|
|
123
|
|
|
124
|
|
|
125
|
0
|
public Query setBinary(String name, byte[] val) {
|
126
|
0
|
log.log("setBinary(" + name + ", " + val + ")");
|
127
|
0
|
return toLogged(super.setBinary(name, val));
|
128
|
|
}
|
129
|
|
|
130
|
|
|
131
|
|
|
132
|
|
|
133
|
0
|
public Query setBoolean(int position, boolean val) {
|
134
|
0
|
log.log("setBoolean(" + position + ", " + val + ")");
|
135
|
0
|
return toLogged(super.setBoolean(position, val));
|
136
|
|
}
|
137
|
|
|
138
|
|
|
139
|
|
|
140
|
|
|
141
|
0
|
public Query setBoolean(String name, boolean val) {
|
142
|
0
|
log.log("setBoolean(" + name + ", " + val + ")");
|
143
|
0
|
return toLogged(super.setBoolean(name, val));
|
144
|
|
}
|
145
|
|
|
146
|
|
|
147
|
|
|
148
|
|
|
149
|
0
|
public Query setByte(int position, byte val) {
|
150
|
0
|
log.log("setByte(" + position + ", " + val + ")");
|
151
|
0
|
return toLogged(super.setByte(position, val));
|
152
|
|
}
|
153
|
|
|
154
|
|
|
155
|
|
|
156
|
|
|
157
|
0
|
public Query setByte(String name, byte val) {
|
158
|
0
|
log.log("setByte(" + name + ", " + val + ")");
|
159
|
0
|
return toLogged(super.setByte(name, val));
|
160
|
|
}
|
161
|
|
|
162
|
|
|
163
|
|
|
164
|
|
|
165
|
0
|
public Query setCacheable(boolean cacheable) {
|
166
|
0
|
log.log("setCacheable(" + cacheable + ")");
|
167
|
0
|
return toLogged(super.setCacheable(cacheable));
|
168
|
|
}
|
169
|
|
|
170
|
|
|
171
|
|
|
172
|
|
|
173
|
0
|
public Query setCacheRegion(String cacheRegion) {
|
174
|
0
|
log.log("setCacheRegion(" + cacheRegion + ")");
|
175
|
0
|
return toLogged(super.setCacheRegion(cacheRegion));
|
176
|
|
}
|
177
|
|
|
178
|
|
|
179
|
|
|
180
|
|
|
181
|
0
|
public Query setCalendar(int position, Calendar calendar) {
|
182
|
0
|
log.log("setCalendar(" + position + ", " + calendar + ")");
|
183
|
0
|
return toLogged(super.setCalendar(position, calendar));
|
184
|
|
}
|
185
|
|
|
186
|
|
|
187
|
|
|
188
|
|
|
189
|
|
|
190
|
0
|
public Query setCalendar(String name, Calendar calendar) {
|
191
|
0
|
log.log("setCalendar(" + name + ", " + calendar + ")");
|
192
|
0
|
return toLogged(super.setCalendar(name, calendar));
|
193
|
|
}
|
194
|
|
|
195
|
|
|
196
|
|
|
197
|
|
|
198
|
0
|
public Query setCalendarDate(int position, Calendar calendar) {
|
199
|
0
|
log.log("setCalendarDate(" + position + ", " + calendar + ")");
|
200
|
0
|
return toLogged(super.setCalendarDate(position, calendar));
|
201
|
|
}
|
202
|
|
|
203
|
|
|
204
|
|
|
205
|
|
|
206
|
|
|
207
|
0
|
public Query setCalendarDate(String name, Calendar calendar) {
|
208
|
0
|
log.log("setCalendarDate(" + name + ", " + calendar + ")");
|
209
|
0
|
return toLogged(super.setCalendarDate(name, calendar));
|
210
|
|
}
|
211
|
|
|
212
|
|
|
213
|
|
|
214
|
|
|
215
|
0
|
public Query setCharacter(int position, char val) {
|
216
|
0
|
log.log("setCharacter(" + position + ", " + val + ")");
|
217
|
0
|
return toLogged(super.setCharacter(position, val));
|
218
|
|
}
|
219
|
|
|
220
|
|
|
221
|
|
|
222
|
|
|
223
|
0
|
public Query setCharacter(String name, char val) {
|
224
|
0
|
log.log("setCharacter(" + name + ", " + val + ")");
|
225
|
0
|
return toLogged(super.setCharacter(name, val));
|
226
|
|
}
|
227
|
|
|
228
|
|
|
229
|
|
|
230
|
|
|
231
|
0
|
public Query setDate(int position, Date date) {
|
232
|
0
|
log.log("setDate(" + position + ", " + date + ")");
|
233
|
0
|
return toLogged(super.setDate(position, date));
|
234
|
|
}
|
235
|
|
|
236
|
|
|
237
|
|
|
238
|
|
|
239
|
0
|
public Query setDate(String name, Date date) {
|
240
|
0
|
log.log("setDate(" + name + ", " + date + ")");
|
241
|
0
|
return toLogged(super.setDate(name, date));
|
242
|
|
}
|
243
|
|
|
244
|
|
|
245
|
|
|
246
|
|
|
247
|
0
|
public Query setDouble(int position, double val) {
|
248
|
0
|
log.log("setDouble(" + position + ", " + val + ")");
|
249
|
0
|
return toLogged(super.setDouble(position, val));
|
250
|
|
}
|
251
|
|
|
252
|
|
|
253
|
|
|
254
|
|
|
255
|
0
|
public Query setDouble(String name, double val) {
|
256
|
0
|
log.log("setDouble(" + name + ", " + val + ")");
|
257
|
0
|
return toLogged(super.setDouble(name, val));
|
258
|
|
}
|
259
|
|
|
260
|
|
|
261
|
|
|
262
|
|
|
263
|
0
|
public Query setEntity(int position, Object val) {
|
264
|
0
|
log.log("setEntity(" + position + ", " + val + ")");
|
265
|
0
|
return toLogged(super.setEntity(position, val));
|
266
|
|
}
|
267
|
|
|
268
|
|
|
269
|
|
|
270
|
|
|
271
|
0
|
public Query setEntity(String name, Object val) {
|
272
|
0
|
log.log("setEntity(" + name + ", " + val + ")");
|
273
|
0
|
return toLogged(super.setEntity(name, val));
|
274
|
|
}
|
275
|
|
|
276
|
|
|
277
|
|
|
278
|
|
|
279
|
|
|
280
|
0
|
public Query setEnum(int position, Object val) throws MappingException {
|
281
|
0
|
log.log("setEnum(" + position + ", " + val + ")");
|
282
|
0
|
return toLogged(super.setEnum(position, val));
|
283
|
|
}
|
284
|
|
|
285
|
|
|
286
|
|
|
287
|
|
|
288
|
|
|
289
|
0
|
public Query setEnum(String name, Object val) throws MappingException {
|
290
|
0
|
log.log("setEnum(" + name + ", " + val + ")");
|
291
|
0
|
return toLogged(super.setEnum(name, val));
|
292
|
|
}
|
293
|
|
|
294
|
|
|
295
|
|
|
296
|
|
|
297
|
0
|
public Query setFirstResult(int firstResult) {
|
298
|
0
|
log.log("setFirstResult(" + firstResult + ")");
|
299
|
0
|
return toLogged(super.setFirstResult(firstResult));
|
300
|
|
}
|
301
|
|
|
302
|
|
|
303
|
|
|
304
|
|
|
305
|
0
|
public Query setFloat(int position, float val) {
|
306
|
0
|
log.log("setFloat(" + position + ", " + val + ")");
|
307
|
0
|
return toLogged(super.setFloat(position, val));
|
308
|
|
}
|
309
|
|
|
310
|
|
|
311
|
|
|
312
|
|
|
313
|
0
|
public Query setFloat(String name, float val) {
|
314
|
0
|
log.log("setFloat(" + name + ", " + val + ")");
|
315
|
0
|
return toLogged(super.setFloat(name, val));
|
316
|
|
}
|
317
|
|
|
318
|
|
|
319
|
|
|
320
|
|
|
321
|
0
|
public Query setInteger(int position, int val) {
|
322
|
0
|
log.log("setInteger(" + position + ", " + val + ")");
|
323
|
0
|
return toLogged(super.setInteger(position, val));
|
324
|
|
}
|
325
|
|
|
326
|
|
|
327
|
|
|
328
|
|
|
329
|
0
|
public Query setInteger(String name, int val) {
|
330
|
0
|
log.log("setInteger(" + name + ", " + val + ")");
|
331
|
0
|
return toLogged(super.setInteger(name, val));
|
332
|
|
}
|
333
|
|
|
334
|
|
|
335
|
|
|
336
|
|
|
337
|
0
|
public Query setLocale(int position, Locale locale) {
|
338
|
0
|
log.log("setLocale(" + position + ", " + locale + ")");
|
339
|
0
|
return toLogged(super.setLocale(position, locale));
|
340
|
|
}
|
341
|
|
|
342
|
|
|
343
|
|
|
344
|
|
|
345
|
0
|
public Query setLocale(String name, Locale locale) {
|
346
|
0
|
log.log("setLocale(" + name + ", " + locale + ")");
|
347
|
0
|
return toLogged(super.setLocale(name, locale));
|
348
|
|
}
|
349
|
|
|
350
|
|
|
351
|
|
|
352
|
|
|
353
|
|
|
354
|
0
|
public void setLockMode(String alias, LockMode lockMode) {
|
355
|
0
|
log.log("setLockMode(" + alias + ", " + lockMode + ")");
|
356
|
0
|
super.setLockMode(alias, lockMode);
|
357
|
|
}
|
358
|
|
|
359
|
|
|
360
|
|
|
361
|
|
|
362
|
0
|
public Query setLong(int position, long val) {
|
363
|
0
|
log.log("setLong(" + position + ", " + val + ")");
|
364
|
0
|
return toLogged(super.setLong(position, val));
|
365
|
|
}
|
366
|
|
|
367
|
|
|
368
|
|
|
369
|
|
|
370
|
0
|
public Query setLong(String name, long val) {
|
371
|
0
|
log.log("setLong(" + name + ", " + val + ")");
|
372
|
0
|
return toLogged(super.setLong(name, val));
|
373
|
|
}
|
374
|
|
|
375
|
|
|
376
|
|
|
377
|
|
|
378
|
0
|
public Query setMaxResults(int maxResults) {
|
379
|
0
|
log.log("setMaxResults(" + maxResults + ")");
|
380
|
0
|
return toLogged(super.setMaxResults(maxResults));
|
381
|
|
}
|
382
|
|
|
383
|
|
|
384
|
|
|
385
|
|
|
386
|
|
|
387
|
0
|
public Query setParameter(int position, Object val, Type type) {
|
388
|
0
|
log.log("setParameter(" + position + ", " + val + ", " + type + ")");
|
389
|
0
|
return toLogged(super.setParameter(position, val, type));
|
390
|
|
}
|
391
|
|
|
392
|
|
|
393
|
|
|
394
|
|
|
395
|
0
|
public Query setParameter(int position, Object val)
|
396
|
|
throws HibernateException {
|
397
|
0
|
log.log("setParameter(" + position + ", " + val + ")");
|
398
|
0
|
return toLogged(super.setParameter(position, val));
|
399
|
|
}
|
400
|
|
|
401
|
|
|
402
|
|
|
403
|
|
|
404
|
|
|
405
|
0
|
public Query setParameter(String name, Object val, Type type) {
|
406
|
0
|
log.log("setParameter(" + name + ", " + val + "," + type + ")");
|
407
|
0
|
return toLogged(super.setParameter(name, val, type));
|
408
|
|
}
|
409
|
|
|
410
|
|
|
411
|
|
|
412
|
|
|
413
|
|
|
414
|
0
|
public Query setParameter(String name, Object val)
|
415
|
|
throws HibernateException {
|
416
|
0
|
log.log("setParameter(" + name + ", " + val + ")");
|
417
|
0
|
return toLogged(super.setParameter(name, val));
|
418
|
|
}
|
419
|
|
|
420
|
|
|
421
|
|
|
422
|
|
|
423
|
|
|
424
|
0
|
public Query setParameterList(String name, Collection vals, Type type)
|
425
|
|
throws HibernateException {
|
426
|
0
|
log.log("setParameterList(" + name + ", " + vals + ", " + type + ")");
|
427
|
0
|
return toLogged(super.setParameterList(name, vals, type));
|
428
|
|
}
|
429
|
|
|
430
|
|
|
431
|
|
|
432
|
|
|
433
|
|
|
434
|
0
|
public Query setParameterList(String name, Collection vals)
|
435
|
|
throws HibernateException {
|
436
|
0
|
log.log("setParameterList(" + name + ", " + vals + ")");
|
437
|
0
|
return toLogged(super.setParameterList(name, vals));
|
438
|
|
}
|
439
|
|
|
440
|
|
|
441
|
|
|
442
|
|
|
443
|
|
|
444
|
0
|
public Query setParameterList(String name, Object[] vals, Type type)
|
445
|
|
throws HibernateException {
|
446
|
0
|
log.log("setParameterList(" + name + ", " + vals + ", " + type + ")");
|
447
|
0
|
return toLogged(super.setParameterList(name, vals, type));
|
448
|
|
}
|
449
|
|
|
450
|
|
|
451
|
|
|
452
|
|
|
453
|
|
|
454
|
0
|
public Query setParameterList(String name, Object[] vals)
|
455
|
|
throws HibernateException {
|
456
|
0
|
log.log("setParameterList(" + name + ", " + vals + ")");
|
457
|
0
|
return toLogged(super.setParameterList(name, vals));
|
458
|
|
}
|
459
|
|
|
460
|
|
|
461
|
|
|
462
|
|
|
463
|
0
|
public Query setProperties(Object bean) throws HibernateException {
|
464
|
0
|
log.log("setProperties(" + bean + ")");
|
465
|
0
|
return toLogged(super.setProperties(bean));
|
466
|
|
}
|
467
|
|
|
468
|
|
|
469
|
|
|
470
|
|
|
471
|
0
|
public Query setSerializable(int position, Serializable val) {
|
472
|
0
|
log.log("setSerializable(" + position + ", " + val + ")");
|
473
|
0
|
return toLogged(super.setSerializable(position, val));
|
474
|
|
}
|
475
|
|
|
476
|
|
|
477
|
|
|
478
|
|
|
479
|
|
|
480
|
0
|
public Query setSerializable(String name, Serializable val) {
|
481
|
0
|
log.log("setSerializable(" + name + ", " + val + ")");
|
482
|
0
|
return toLogged(super.setSerializable(name, val));
|
483
|
|
}
|
484
|
|
|
485
|
|
|
486
|
|
|
487
|
|
|
488
|
0
|
public Query setShort(int position, short val) {
|
489
|
0
|
log.log("setShort(" + position + ", " + val + ")");
|
490
|
0
|
return toLogged(super.setShort(position, val));
|
491
|
|
}
|
492
|
|
|
493
|
|
|
494
|
|
|
495
|
|
|
496
|
0
|
public Query setShort(String name, short val) {
|
497
|
0
|
log.log("setShort(" + name + ", " + val + ")");
|
498
|
0
|
return toLogged(super.setShort(name, val));
|
499
|
|
}
|
500
|
|
|
501
|
|
|
502
|
|
|
503
|
|
|
504
|
0
|
public Query setString(int position, String val) {
|
505
|
0
|
log.log("setString(" + position + ", " + val + ")");
|
506
|
0
|
return toLogged(super.setString(position, val));
|
507
|
|
}
|
508
|
|
|
509
|
|
|
510
|
|
|
511
|
|
|
512
|
0
|
public Query setString(String name, String val) {
|
513
|
0
|
log.log("setString(" + name + ", " + val + ")");
|
514
|
0
|
return toLogged(super.setString(name, val));
|
515
|
|
}
|
516
|
|
|
517
|
|
|
518
|
|
|
519
|
|
|
520
|
0
|
public Query setText(int position, String val) {
|
521
|
0
|
log.log("setText(" + position + ", " + val + ")");
|
522
|
0
|
return toLogged(super.setText(position, val));
|
523
|
|
}
|
524
|
|
|
525
|
|
|
526
|
|
|
527
|
|
|
528
|
0
|
public Query setText(String name, String val) {
|
529
|
0
|
log.log("setText(" + name + ", " + val + ")");
|
530
|
0
|
return toLogged(super.setText(name, val));
|
531
|
|
}
|
532
|
|
|
533
|
|
|
534
|
|
|
535
|
|
|
536
|
0
|
public Query setTime(int position, Date date) {
|
537
|
0
|
log.log("setTime(" + position + ", " + date + ")");
|
538
|
0
|
return toLogged(super.setTime(position, date));
|
539
|
|
}
|
540
|
|
|
541
|
|
|
542
|
|
|
543
|
|
|
544
|
0
|
public Query setTime(String name, Date date) {
|
545
|
0
|
log.log("setTime(" + name + ", " + date + ")");
|
546
|
0
|
return toLogged(super.setTime(name, date));
|
547
|
|
}
|
548
|
|
|
549
|
|
|
550
|
|
|
551
|
|
|
552
|
0
|
public Query setTimeout(int timeout) {
|
553
|
0
|
log.log("setTimeout(" + timeout + ")");
|
554
|
0
|
return toLogged(super.setTimeout(timeout));
|
555
|
|
}
|
556
|
|
|
557
|
|
|
558
|
|
|
559
|
|
|
560
|
0
|
public Query setTimestamp(int position, Date date) {
|
561
|
0
|
log.log("setTimestamp(" + position + ", " + date + ")");
|
562
|
0
|
return toLogged(super.setTimestamp(position, date));
|
563
|
|
}
|
564
|
|
|
565
|
|
|
566
|
|
|
567
|
|
|
568
|
|
|
569
|
0
|
public Query setTimestamp(String name, Date date) {
|
570
|
0
|
log.log("setTimestamp(" + name + ", " + date + ")");
|
571
|
0
|
return toLogged(super.setTimestamp(name, date));
|
572
|
|
}
|
573
|
|
|
574
|
|
|
575
|
|
|
576
|
|
|
577
|
0
|
public Object uniqueResult() throws HibernateException {
|
578
|
0
|
return super.uniqueResult();
|
579
|
|
}
|
580
|
|
|
581
|
|
}
|