01: /**
02: * Copyright (C) 2006, 2007 David Bulmore, Software Sensation Inc.
03: * All Rights Reserved.
04: *
05: * This file is part of JPersist.
06: *
07: * JPersist is free software; you can redistribute it and/or modify it under
08: * the terms of the GNU General Public License (Version 2) as published by
09: * the Free Software Foundation.
10: *
11: * JPersist is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with JPersist; if not, write to the Free Software Foundation,
18: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19: */package jpersist.utils;
20:
21: import java.sql.PreparedStatement;
22:
23: public abstract class PreparedUpdateAdapter implements PreparedUpdate {
24: int returnValue;
25: long generatedKey;
26: boolean hasNext = true;
27:
28: public boolean hasNextUpdate() {
29: if (hasNext)
30: return !(hasNext = false);
31:
32: return false;
33: }
34:
35: public abstract void prepareUpdate(
36: PreparedStatement preparedStatement) throws Exception;
37:
38: public String[] getGeneratedKeys() {
39: return null;
40: }
41:
42: public void setReturnValue(int returnValue) throws Exception {
43: this .returnValue = returnValue;
44: }
45:
46: public int getReturnValue() {
47: return this .returnValue;
48: }
49:
50: public void setGeneratedKey(long key) throws Exception {
51: this .generatedKey = key;
52: }
53:
54: public long getGeneratedKey() {
55: return generatedKey;
56: }
57: }
|