|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
SessionWrapper.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Joey and its relative products are published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
/*
|
|
6 |
* Created on 2004/02/29
|
|
7 |
*/
|
|
8 |
package org.asyrinx.brownie.hibernate.wrapper;
|
|
9 |
|
|
10 |
import java.io.Serializable;
|
|
11 |
import java.sql.Connection;
|
|
12 |
import java.util.Collection;
|
|
13 |
import java.util.Iterator;
|
|
14 |
import java.util.List;
|
|
15 |
|
|
16 |
import net.sf.hibernate.Criteria;
|
|
17 |
import net.sf.hibernate.FlushMode;
|
|
18 |
import net.sf.hibernate.HibernateException;
|
|
19 |
import net.sf.hibernate.LockMode;
|
|
20 |
import net.sf.hibernate.Query;
|
|
21 |
import net.sf.hibernate.ReplicationMode;
|
|
22 |
import net.sf.hibernate.Session;
|
|
23 |
import net.sf.hibernate.SessionFactory;
|
|
24 |
import net.sf.hibernate.Transaction;
|
|
25 |
import net.sf.hibernate.type.Type;
|
|
26 |
|
|
27 |
/**
|
|
28 |
* @author akima
|
|
29 |
*/
|
|
30 |
public class SessionWrapper implements Session { |
|
31 |
|
|
32 |
/**
|
|
33 |
*
|
|
34 |
*/
|
|
35 | 0 |
public SessionWrapper(Session wrapped) {
|
36 | 0 |
super();
|
37 | 0 |
this.wrapped = wrapped;
|
38 |
} |
|
39 |
|
|
40 |
protected final Session wrapped;
|
|
41 |
|
|
42 |
/**
|
|
43 |
* @return @throws
|
|
44 |
* net.sf.hibernate.HibernateException
|
|
45 |
*/
|
|
46 | 0 |
public Transaction beginTransaction() throws HibernateException { |
47 | 0 |
return wrapped.beginTransaction();
|
48 |
} |
|
49 |
|
|
50 |
/**
|
|
51 |
* @throws net.sf.hibernate.HibernateException
|
|
52 |
*/
|
|
53 | 0 |
public void cancelQuery() throws HibernateException { |
54 | 0 |
wrapped.cancelQuery(); |
55 |
} |
|
56 |
|
|
57 |
/**
|
|
58 |
*
|
|
59 |
*/
|
|
60 | 0 |
public void clear() { |
61 | 0 |
wrapped.clear(); |
62 |
} |
|
63 |
|
|
64 |
/**
|
|
65 |
* @return @throws
|
|
66 |
* net.sf.hibernate.HibernateException
|
|
67 |
*/
|
|
68 | 0 |
public Connection close() throws HibernateException { |
69 | 0 |
return wrapped.close();
|
70 |
} |
|
71 |
|
|
72 |
/**
|
|
73 |
* @return @throws
|
|
74 |
* net.sf.hibernate.HibernateException
|
|
75 |
*/
|
|
76 | 0 |
public Connection connection() throws HibernateException { |
77 | 0 |
return wrapped.connection();
|
78 |
} |
|
79 |
|
|
80 |
/**
|
|
81 |
* @param object
|
|
82 |
* @return
|
|
83 |
*/
|
|
84 | 0 |
public boolean contains(Object object) { |
85 | 0 |
return wrapped.contains(object);
|
86 |
} |
|
87 |
|
|
88 |
/**
|
|
89 |
* @param persistentClass
|
|
90 |
* @return
|
|
91 |
*/
|
|
92 | 0 |
public Criteria createCriteria(Class persistentClass) {
|
93 | 0 |
return wrapped.createCriteria(persistentClass);
|
94 |
} |
|
95 |
|
|
96 |
/**
|
|
97 |
* @param collection
|
|
98 |
* @param queryString
|
|
99 |
* @return @throws
|
|
100 |
* net.sf.hibernate.HibernateException
|
|
101 |
*/
|
|
102 | 0 |
public Query createFilter(Object collection, String queryString)
|
103 |
throws HibernateException {
|
|
104 | 0 |
return wrapped.createFilter(collection, queryString);
|
105 |
} |
|
106 |
|
|
107 |
/**
|
|
108 |
* @param queryString
|
|
109 |
* @return @throws
|
|
110 |
* net.sf.hibernate.HibernateException
|
|
111 |
*/
|
|
112 | 0 |
public Query createQuery(String queryString) throws HibernateException { |
113 | 0 |
return wrapped.createQuery(queryString);
|
114 |
} |
|
115 |
|
|
116 |
/**
|
|
117 |
* @param sql
|
|
118 |
* @param returnAlias
|
|
119 |
* @param returnClass
|
|
120 |
* @return
|
|
121 |
*/
|
|
122 | 0 |
public Query createSQLQuery(String sql, String returnAlias,
|
123 |
Class returnClass) { |
|
124 | 0 |
return wrapped.createSQLQuery(sql, returnAlias, returnClass);
|
125 |
} |
|
126 |
|
|
127 |
/**
|
|
128 |
* @param sql
|
|
129 |
* @param returnAliases
|
|
130 |
* @param returnClasses
|
|
131 |
* @return
|
|
132 |
*/
|
|
133 | 0 |
public Query createSQLQuery(String sql, String[] returnAliases,
|
134 |
Class[] returnClasses) { |
|
135 | 0 |
return wrapped.createSQLQuery(sql, returnAliases, returnClasses);
|
136 |
} |
|
137 |
|
|
138 |
/**
|
|
139 |
* @param object
|
|
140 |
* @throws net.sf.hibernate.HibernateException
|
|
141 |
*/
|
|
142 | 0 |
public void delete(Object object) throws HibernateException { |
143 | 0 |
wrapped.delete(object); |
144 |
} |
|
145 |
|
|
146 |
/**
|
|
147 |
* @param query
|
|
148 |
* @return @throws
|
|
149 |
* net.sf.hibernate.HibernateException
|
|
150 |
*/
|
|
151 | 0 |
public int delete(String query) throws HibernateException { |
152 | 0 |
return wrapped.delete(query);
|
153 |
} |
|
154 |
|
|
155 |
/**
|
|
156 |
* @param query
|
|
157 |
* @param value
|
|
158 |
* @param type
|
|
159 |
* @return @throws
|
|
160 |
* net.sf.hibernate.HibernateException
|
|
161 |
*/
|
|
162 | 0 |
public int delete(String query, Object value, Type type) |
163 |
throws HibernateException {
|
|
164 | 0 |
return wrapped.delete(query, value, type);
|
165 |
} |
|
166 |
|
|
167 |
/**
|
|
168 |
* @param query
|
|
169 |
* @param values
|
|
170 |
* @param types
|
|
171 |
* @return @throws
|
|
172 |
* net.sf.hibernate.HibernateException
|
|
173 |
*/
|
|
174 | 0 |
public int delete(String query, Object[] values, Type[] types) |
175 |
throws HibernateException {
|
|
176 | 0 |
return wrapped.delete(query, values, types);
|
177 |
} |
|
178 |
|
|
179 |
/**
|
|
180 |
* @return @throws
|
|
181 |
* net.sf.hibernate.HibernateException
|
|
182 |
*/
|
|
183 | 0 |
public Connection disconnect() throws HibernateException { |
184 | 0 |
return wrapped.disconnect();
|
185 |
} |
|
186 |
|
|
187 |
/**
|
|
188 |
* @param object
|
|
189 |
* @throws net.sf.hibernate.HibernateException
|
|
190 |
*/
|
|
191 | 0 |
public void evict(Object object) throws HibernateException { |
192 | 0 |
wrapped.evict(object); |
193 |
} |
|
194 |
|
|
195 |
/**
|
|
196 |
* @param collection
|
|
197 |
* @param filter
|
|
198 |
* @return @throws
|
|
199 |
* net.sf.hibernate.HibernateException
|
|
200 |
*/
|
|
201 | 0 |
public Collection filter(Object collection, String filter)
|
202 |
throws HibernateException {
|
|
203 | 0 |
return wrapped.filter(collection, filter);
|
204 |
} |
|
205 |
|
|
206 |
/**
|
|
207 |
* @param collection
|
|
208 |
* @param filter
|
|
209 |
* @param value
|
|
210 |
* @param type
|
|
211 |
* @return @throws
|
|
212 |
* net.sf.hibernate.HibernateException
|
|
213 |
*/
|
|
214 | 0 |
public Collection filter(Object collection, String filter, Object value,
|
215 |
Type type) throws HibernateException {
|
|
216 | 0 |
return wrapped.filter(collection, filter, value, type);
|
217 |
} |
|
218 |
|
|
219 |
/**
|
|
220 |
* @param collection
|
|
221 |
* @param filter
|
|
222 |
* @param values
|
|
223 |
* @param types
|
|
224 |
* @return @throws
|
|
225 |
* net.sf.hibernate.HibernateException
|
|
226 |
*/
|
|
227 | 0 |
public Collection filter(Object collection, String filter, Object[] values,
|
228 |
Type[] types) throws HibernateException {
|
|
229 | 0 |
return wrapped.filter(collection, filter, values, types);
|
230 |
} |
|
231 |
|
|
232 |
/**
|
|
233 |
* @param query
|
|
234 |
* @return @throws
|
|
235 |
* net.sf.hibernate.HibernateException
|
|
236 |
*/
|
|
237 | 0 |
public List find(String query) throws HibernateException { |
238 | 0 |
return wrapped.find(query);
|
239 |
} |
|
240 |
|
|
241 |
/**
|
|
242 |
* @param query
|
|
243 |
* @param value
|
|
244 |
* @param type
|
|
245 |
* @return @throws
|
|
246 |
* net.sf.hibernate.HibernateException
|
|
247 |
*/
|
|
248 | 0 |
public List find(String query, Object value, Type type)
|
249 |
throws HibernateException {
|
|
250 | 0 |
return wrapped.find(query, value, type);
|
251 |
} |
|
252 |
|
|
253 |
/**
|
|
254 |
* @param query
|
|
255 |
* @param values
|
|
256 |
* @param types
|
|
257 |
* @return @throws
|
|
258 |
* net.sf.hibernate.HibernateException
|
|
259 |
*/
|
|
260 | 0 |
public List find(String query, Object[] values, Type[] types)
|
261 |
throws HibernateException {
|
|
262 | 0 |
return wrapped.find(query, values, types);
|
263 |
} |
|
264 |
|
|
265 |
/**
|
|
266 |
* @throws net.sf.hibernate.HibernateException
|
|
267 |
*/
|
|
268 | 0 |
public void flush() throws HibernateException { |
269 | 0 |
wrapped.flush(); |
270 |
} |
|
271 |
|
|
272 |
/**
|
|
273 |
* @param clazz
|
|
274 |
* @param id
|
|
275 |
* @return @throws
|
|
276 |
* net.sf.hibernate.HibernateException
|
|
277 |
*/
|
|
278 | 0 |
public Object get(Class clazz, Serializable id) throws HibernateException { |
279 | 0 |
return wrapped.get(clazz, id);
|
280 |
} |
|
281 |
|
|
282 |
/**
|
|
283 |
* @param clazz
|
|
284 |
* @param id
|
|
285 |
* @param lockMode
|
|
286 |
* @return @throws
|
|
287 |
* net.sf.hibernate.HibernateException
|
|
288 |
*/
|
|
289 | 0 |
public Object get(Class clazz, Serializable id, LockMode lockMode)
|
290 |
throws HibernateException {
|
|
291 | 0 |
return wrapped.get(clazz, id, lockMode);
|
292 |
} |
|
293 |
|
|
294 |
/**
|
|
295 |
* @param object
|
|
296 |
* @return @throws
|
|
297 |
* net.sf.hibernate.HibernateException
|
|
298 |
*/
|
|
299 | 0 |
public LockMode getCurrentLockMode(Object object) throws HibernateException { |
300 | 0 |
return wrapped.getCurrentLockMode(object);
|
301 |
} |
|
302 |
|
|
303 |
/**
|
|
304 |
* @return
|
|
305 |
*/
|
|
306 | 0 |
public FlushMode getFlushMode() {
|
307 | 0 |
return wrapped.getFlushMode();
|
308 |
} |
|
309 |
|
|
310 |
/**
|
|
311 |
* @param object
|
|
312 |
* @return @throws
|
|
313 |
* net.sf.hibernate.HibernateException
|
|
314 |
*/
|
|
315 | 0 |
public Serializable getIdentifier(Object object) throws HibernateException { |
316 | 0 |
return wrapped.getIdentifier(object);
|
317 |
} |
|
318 |
|
|
319 |
/**
|
|
320 |
* @param queryName
|
|
321 |
* @return @throws
|
|
322 |
* net.sf.hibernate.HibernateException
|
|
323 |
*/
|
|
324 | 0 |
public Query getNamedQuery(String queryName) throws HibernateException { |
325 | 0 |
return wrapped.getNamedQuery(queryName);
|
326 |
} |
|
327 |
|
|
328 |
/**
|
|
329 |
* @return
|
|
330 |
*/
|
|
331 | 0 |
public SessionFactory getSessionFactory() {
|
332 | 0 |
return wrapped.getSessionFactory();
|
333 |
} |
|
334 |
|
|
335 |
/**
|
|
336 |
* @return
|
|
337 |
*/
|
|
338 | 0 |
public boolean isConnected() { |
339 | 0 |
return wrapped.isConnected();
|
340 |
} |
|
341 |
|
|
342 |
/**
|
|
343 |
* @return
|
|
344 |
*/
|
|
345 | 0 |
public boolean isOpen() { |
346 | 0 |
return wrapped.isOpen();
|
347 |
} |
|
348 |
|
|
349 |
/**
|
|
350 |
* @param query
|
|
351 |
* @return @throws
|
|
352 |
* net.sf.hibernate.HibernateException
|
|
353 |
*/
|
|
354 | 0 |
public Iterator iterate(String query) throws HibernateException { |
355 | 0 |
return wrapped.iterate(query);
|
356 |
} |
|
357 |
|
|
358 |
/**
|
|
359 |
* @param query
|
|
360 |
* @param value
|
|
361 |
* @param type
|
|
362 |
* @return @throws
|
|
363 |
* net.sf.hibernate.HibernateException
|
|
364 |
*/
|
|
365 | 0 |
public Iterator iterate(String query, Object value, Type type)
|
366 |
throws HibernateException {
|
|
367 | 0 |
return wrapped.iterate(query, value, type);
|
368 |
} |
|
369 |
|
|
370 |
/**
|
|
371 |
* @param query
|
|
372 |
* @param values
|
|
373 |
* @param types
|
|
374 |
* @return @throws
|
|
375 |
* net.sf.hibernate.HibernateException
|
|
376 |
*/
|
|
377 | 0 |
public Iterator iterate(String query, Object[] values, Type[] types)
|
378 |
throws HibernateException {
|
|
379 | 0 |
return wrapped.iterate(query, values, types);
|
380 |
} |
|
381 |
|
|
382 |
/**
|
|
383 |
* @param theClass
|
|
384 |
* @param id
|
|
385 |
* @return @throws
|
|
386 |
* net.sf.hibernate.HibernateException
|
|
387 |
*/
|
|
388 | 0 |
public Object load(Class theClass, Serializable id)
|
389 |
throws HibernateException {
|
|
390 | 0 |
return wrapped.load(theClass, id);
|
391 |
} |
|
392 |
|
|
393 |
/**
|
|
394 |
* @param theClass
|
|
395 |
* @param id
|
|
396 |
* @param lockMode
|
|
397 |
* @return @throws
|
|
398 |
* net.sf.hibernate.HibernateException
|
|
399 |
*/
|
|
400 | 0 |
public Object load(Class theClass, Serializable id, LockMode lockMode)
|
401 |
throws HibernateException {
|
|
402 | 0 |
return wrapped.load(theClass, id, lockMode);
|
403 |
} |
|
404 |
|
|
405 |
/**
|
|
406 |
* @param object
|
|
407 |
* @param id
|
|
408 |
* @throws net.sf.hibernate.HibernateException
|
|
409 |
*/
|
|
410 | 0 |
public void load(Object object, Serializable id) throws HibernateException { |
411 | 0 |
wrapped.load(object, id); |
412 |
} |
|
413 |
|
|
414 |
/**
|
|
415 |
* @param object
|
|
416 |
* @param lockMode
|
|
417 |
* @throws net.sf.hibernate.HibernateException
|
|
418 |
*/
|
|
419 | 0 |
public void lock(Object object, LockMode lockMode) |
420 |
throws HibernateException {
|
|
421 | 0 |
wrapped.lock(object, lockMode); |
422 |
} |
|
423 |
|
|
424 |
/**
|
|
425 |
* @throws net.sf.hibernate.HibernateException
|
|
426 |
*/
|
|
427 | 0 |
public void reconnect() throws HibernateException { |
428 | 0 |
wrapped.reconnect(); |
429 |
} |
|
430 |
|
|
431 |
/**
|
|
432 |
* @param connection
|
|
433 |
* @throws net.sf.hibernate.HibernateException
|
|
434 |
*/
|
|
435 | 0 |
public void reconnect(Connection connection) throws HibernateException { |
436 | 0 |
wrapped.reconnect(connection); |
437 |
} |
|
438 |
|
|
439 |
/**
|
|
440 |
* @param object
|
|
441 |
* @throws net.sf.hibernate.HibernateException
|
|
442 |
*/
|
|
443 | 0 |
public void refresh(Object object) throws HibernateException { |
444 | 0 |
wrapped.refresh(object); |
445 |
} |
|
446 |
|
|
447 |
/**
|
|
448 |
* @param object
|
|
449 |
* @param lockMode
|
|
450 |
* @throws net.sf.hibernate.HibernateException
|
|
451 |
*/
|
|
452 | 0 |
public void refresh(Object object, LockMode lockMode) |
453 |
throws HibernateException {
|
|
454 | 0 |
wrapped.refresh(object, lockMode); |
455 |
} |
|
456 |
|
|
457 |
/**
|
|
458 |
* @param object
|
|
459 |
* @param replicationMode
|
|
460 |
* @throws net.sf.hibernate.HibernateException
|
|
461 |
*/
|
|
462 | 0 |
public void replicate(Object object, ReplicationMode replicationMode) |
463 |
throws HibernateException {
|
|
464 | 0 |
wrapped.replicate(object, replicationMode); |
465 |
} |
|
466 |
|
|
467 |
/**
|
|
468 |
* @param object
|
|
469 |
* @return @throws
|
|
470 |
* net.sf.hibernate.HibernateException
|
|
471 |
*/
|
|
472 | 0 |
public Serializable save(Object object) throws HibernateException { |
473 | 0 |
return wrapped.save(object);
|
474 |
} |
|
475 |
|
|
476 |
/**
|
|
477 |
* @param object
|
|
478 |
* @param id
|
|
479 |
* @throws net.sf.hibernate.HibernateException
|
|
480 |
*/
|
|
481 | 0 |
public void save(Object object, Serializable id) throws HibernateException { |
482 | 0 |
wrapped.save(object, id); |
483 |
} |
|
484 |
|
|
485 |
/**
|
|
486 |
* @param object
|
|
487 |
* @throws net.sf.hibernate.HibernateException
|
|
488 |
*/
|
|
489 | 0 |
public void saveOrUpdate(Object object) throws HibernateException { |
490 | 0 |
wrapped.saveOrUpdate(object); |
491 |
} |
|
492 |
|
|
493 |
/**
|
|
494 |
* @param object
|
|
495 |
* @return @throws
|
|
496 |
* net.sf.hibernate.HibernateException
|
|
497 |
*/
|
|
498 | 0 |
public Object saveOrUpdateCopy(Object object) throws HibernateException { |
499 | 0 |
return wrapped.saveOrUpdateCopy(object);
|
500 |
} |
|
501 |
|
|
502 |
/**
|
|
503 |
* @param object
|
|
504 |
* @param id
|
|
505 |
* @return @throws
|
|
506 |
* net.sf.hibernate.HibernateException
|
|
507 |
*/
|
|
508 | 0 |
public Object saveOrUpdateCopy(Object object, Serializable id)
|
509 |
throws HibernateException {
|
|
510 | 0 |
return wrapped.saveOrUpdateCopy(object, id);
|
511 |
} |
|
512 |
|
|
513 |
/**
|
|
514 |
* @param flushMode
|
|
515 |
*/
|
|
516 | 0 |
public void setFlushMode(FlushMode flushMode) { |
517 | 0 |
wrapped.setFlushMode(flushMode); |
518 |
} |
|
519 |
|
|
520 |
/**
|
|
521 |
* @param object
|
|
522 |
* @throws net.sf.hibernate.HibernateException
|
|
523 |
*/
|
|
524 | 0 |
public void update(Object object) throws HibernateException { |
525 | 0 |
wrapped.update(object); |
526 |
} |
|
527 |
|
|
528 |
/**
|
|
529 |
* @param object
|
|
530 |
* @param id
|
|
531 |
* @throws net.sf.hibernate.HibernateException
|
|
532 |
*/
|
|
533 | 0 |
public void update(Object object, Serializable id) |
534 |
throws HibernateException {
|
|
535 | 0 |
wrapped.update(object, id); |
536 |
} |
|
537 |
|
|
538 |
/**
|
|
539 |
* @return @throws
|
|
540 |
* net.sf.hibernate.HibernateException
|
|
541 |
*/
|
|
542 | 0 |
public boolean isDirty() throws HibernateException { |
543 | 0 |
return wrapped.isDirty();
|
544 |
} |
|
545 |
|
|
546 |
} |
|