01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: DbTransactionUserWithoutResult.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.database;
09:
10: import com.uwyn.rife.tools.InnerClassException;
11:
12: /**
13: * Convenience class that offers the same facilities as the
14: * <code>DbTransactionUser</code> class, but makes it easier to work with
15: * transactions that don't return any results.
16: *
17: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
18: * @version $Revision: 3634 $
19: * @see DbTransactionUser
20: * @since 1.0
21: */
22: public abstract class DbTransactionUserWithoutResult<DataType> extends
23: DbTransactionUser<Object, DataType> {
24: public DbTransactionUserWithoutResult() {
25: }
26:
27: public DbTransactionUserWithoutResult(DataType data) {
28: super (data);
29: }
30:
31: /**
32: * Has been implemented to return a <code>null</code> reference and
33: * delegate the logic to the <code>useTransactionWithoutResult()</code>
34: * method.
35: *
36: * @since 1.0
37: */
38: public Object useTransaction() throws InnerClassException {
39: useTransactionWithoutResult();
40: return null;
41: }
42:
43: /**
44: * Should be implemented by all extending classes.
45: *
46: * @since 1.0
47: */
48: public abstract void useTransactionWithoutResult()
49: throws InnerClassException;
50: }
|