01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.platforms.stores.base;
09:
10: //base classes
11: import java.math.BigDecimal;
12: import java.sql.PreparedStatement;
13: import java.sql.ResultSet;
14: import java.sql.SQLException;
15: import java.util.ArrayList;
16:
17: //project specific classes
18: import org.jfolder.platforms.stores.base.SystemStatement;
19:
20: //other classes
21:
22: public class UpdateStatement extends WhereStatement {
23:
24: private int updateCount = 0;
25: private CreateStatement wcs = null;
26: //
27: private ArrayList updateColumnNames = null;
28: private ArrayList updateColumnValues = null;
29:
30: protected UpdateStatement(CreateStatement inWcs) {
31: //
32: this .wcs = inWcs;
33: //
34: addToAllTables(inWcs);
35: //
36: this .updateColumnNames = new ArrayList();
37: this .updateColumnValues = new ArrayList();
38: }
39:
40: public CreateStatement getEntity() {
41: return this .wcs;
42: }
43:
44: //
45: public void addUpdateColumn(String inColumnName,
46: Object inColumnValue) {
47: this .updateColumnNames.add(inColumnName);
48: this .updateColumnValues.add(inColumnValue);
49: }
50:
51: public int getUpdateColumnCount() {
52: return this .updateColumnNames.size();
53: }
54:
55: public String getUpdateColumnName(int inIndex) {
56: return (String) this .updateColumnNames.get(inIndex);
57: }
58:
59: public Object getUpdateColumnValue(int inIndex) {
60: return this .updateColumnValues.get(inIndex);
61: }
62:
63: //
64: public void setUpdateCount(int inDeleteCount) {
65: this .updateCount = inDeleteCount;
66: }
67:
68: public int getUpdateCount() {
69: return this.updateCount;
70: }
71: }
|