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.workflow.query;
09:
10: //base classes
11: import java.util.ArrayList;
12:
13: //project specific classes
14:
15: //other classes
16:
17: public class StatementContainer {
18:
19: private ColumnContainer cc = null;
20: private QueryContainer qc = null;
21: private ArrayList attrNames = null;
22: private ArrayList attrTypes = null;
23:
24: private StatementContainer() {
25: }
26:
27: public final static StatementContainer createStatement(
28: ColumnContainer inCc, QueryContainer inQc) {
29: StatementContainer outValue = new StatementContainer();
30: outValue.attrNames = new ArrayList();
31: outValue.attrTypes = new ArrayList();
32: outValue.cc = inCc;
33: outValue.qc = inQc;
34: return outValue;
35: }
36:
37: public void registerAttribute(String inAttrName, boolean inSystem) {
38: this .attrNames.add(inAttrName);
39: this .attrTypes.add(new Boolean(inSystem));
40: }
41:
42: public int getAttributeCount() {
43: return this .attrNames.size();
44: }
45:
46: public String getAttributeName(int inIndex) {
47: return (String) this .attrNames.get(inIndex);
48: }
49:
50: public boolean isSystemAttribute(int inIndex) {
51: return ((Boolean) this .attrTypes.get(inIndex)).booleanValue();
52: }
53:
54: public QueryContainer getPredicate() {
55: return this .qc;
56: }
57:
58: public ColumnContainer getColumns() {
59: return this .cc;
60: }
61:
62: //public void prepareQuery(StringBuffer inSb, ArrayList inParameters,
63: // QueryVendor inQv) {
64: //
65: // inQv.prepareStatement(inSb, inParameters, this);
66: //}
67: }
|