Source Code Cross Referenced for SelectStatement.java in  » Workflow-Engines » JFolder » org » jfolder » platforms » stores » base » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » JFolder » org.jfolder.platforms.stores.base 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.platforms.stores.base;
009:
010:        //base classes
011:        import java.math.BigDecimal;
012:        import java.sql.PreparedStatement;
013:        import java.sql.ResultSet;
014:        import java.sql.SQLException;
015:        import java.util.ArrayList;
016:        import java.util.HashSet;
017:        import java.util.Iterator;
018:
019:        //project specific classes
020:        import org.jfolder.platforms.stores.base.SystemStatement;
021:
022:        //other classes
023:
024:        public class SelectStatement extends WhereStatement {
025:
026:            //
027:            private ArrayList selectColumnNames = null;
028:            private ArrayList selectColumnTypes = null;
029:            private ArrayList selectColumnTables = null;
030:            private ArrayList selectColumnQuantifiers = null;
031:            //
032:            private HashSet selectColumnTablesSet = null;
033:
034:            //
035:            private boolean lastSeriesSequenceOnly = false;
036:
037:            //
038:            private ArrayList groupByColumnNames = null;
039:            private ArrayList groupByColumnTypes = null;
040:            private ArrayList groupByColumnTables = null;
041:
042:            //
043:            private String orderByName = null;
044:            private Integer orderByType = null;
045:            private CreateStatement orderByTable = null;
046:
047:            //
048:            private boolean listOrderAscending = false;
049:
050:            //
051:            private int startRow = 0;
052:            private int querySize = 0;
053:
054:            //
055:            private SystemResultSet results = null;
056:
057:            //
058:            //private WorkflowResultSet wrs = null;
059:
060:            public final static SelectStatement createOrderByColumn(
061:                    String inName, CreateStatement inTable, Integer inQuantifier) {
062:
063:                return new SelectStatement(inName, NORMAL_COLUMN, inTable,
064:                        inQuantifier);
065:            }
066:
067:            public final static SelectStatement createOrderById(
068:                    CreateStatement inTable, Integer inQuantifier) {
069:
070:                return new SelectStatement(null, ID_COLUMN, inTable,
071:                        inQuantifier);
072:            }
073:
074:            public final static SelectStatement createOrderBySeriesSequence(
075:                    CreateStatement inTable, Integer inQuantifier) {
076:
077:                return new SelectStatement(null, SERIES_SEQUENCE_COLUMN,
078:                        inTable, inQuantifier);
079:            }
080:
081:            private SelectStatement(String inName, Integer inType,
082:                    CreateStatement inTable, Integer inQuantifier) {
083:                //
084:                this .selectColumnNames = new ArrayList();
085:                this .selectColumnTypes = new ArrayList();
086:                this .selectColumnTables = new ArrayList();
087:                this .selectColumnQuantifiers = new ArrayList();
088:                //
089:                this .selectColumnTablesSet = new HashSet();
090:
091:                //
092:                this .groupByColumnNames = new ArrayList();
093:                this .groupByColumnTypes = new ArrayList();
094:                this .groupByColumnTables = new ArrayList();
095:
096:                //
097:                this .lastSeriesSequenceOnly = true;
098:
099:                //
100:                this .listOrderAscending = true;
101:
102:                //
103:                this .startRow = 0;
104:                this .querySize = 1000;
105:
106:                //init
107:                addSelectColumn(inName, inType, inTable, inQuantifier);
108:                //
109:                this .orderByName = inName;
110:                this .orderByType = inType;
111:                this .orderByTable = inTable;
112:            }
113:
114:            public void addSelectColumn(String inName, CreateStatement inTable,
115:                    Integer inQuantifier) {
116:                addSelectColumn(inName, NORMAL_COLUMN, inTable, inQuantifier);
117:            }
118:
119:            public void addSelectIdColumn(CreateStatement inTable,
120:                    Integer inQuantifier) {
121:                addSelectColumn(null, ID_COLUMN, inTable, inQuantifier);
122:            }
123:
124:            public void addSelectSeriesSequenceColumn(CreateStatement inTable,
125:                    Integer inQuantifier) {
126:                addSelectColumn(null, SERIES_SEQUENCE_COLUMN, inTable,
127:                        inQuantifier);
128:            }
129:
130:            //
131:            private void addSelectColumn(String inName, Integer inType,
132:                    CreateStatement inTable, Integer inQuantifier) {
133:                //
134:                this .selectColumnNames.add(inName);
135:                this .selectColumnTypes.add(inType);
136:                this .selectColumnTables.add(inTable);
137:                this .selectColumnQuantifiers.add(inQuantifier);
138:                //
139:                this .selectColumnTablesSet.add(inTable);
140:                //
141:                addToAllTables(inTable);
142:            }
143:
144:            //
145:            public int getSelectColumnCount() {
146:                return this .selectColumnNames.size();
147:            }
148:
149:            public String getSelectColumnName(int inIndex) {
150:                return (String) this .selectColumnNames.get(inIndex);
151:            }
152:
153:            public Integer getSelectColumnMetaType(int inIndex) {
154:                return (Integer) this .selectColumnTypes.get(inIndex);
155:            }
156:
157:            public CreateStatement getSelectColumnTable(int inIndex) {
158:                return (CreateStatement) this .selectColumnTables.get(inIndex);
159:            }
160:
161:            public Integer getSelectColumnQuantifier(int inIndex) {
162:                return (Integer) this .selectColumnQuantifiers.get(inIndex);
163:            }
164:
165:            //
166:            public void addGroupByColumn(String inName, Integer inType,
167:                    CreateStatement inTable) {
168:
169:                this .groupByColumnNames.add(inName);
170:                this .groupByColumnTypes.add(inType);
171:                this .groupByColumnTables.add(inTable);
172:                //
173:                addToAllTables(inTable);
174:            }
175:
176:            public int getGroupByColumnCount() {
177:                return this .groupByColumnNames.size();
178:            }
179:
180:            public String getGroupByColumnName(int inIndex) {
181:                return (String) this .groupByColumnNames.get(inIndex);
182:            }
183:
184:            public Integer getGroupByColumnType(int inIndex) {
185:                return (Integer) this .groupByColumnTypes.get(inIndex);
186:            }
187:
188:            public CreateStatement getGroupByColumnTable(int inIndex) {
189:                return (CreateStatement) this .groupByColumnTables.get(inIndex);
190:            }
191:
192:            //
193:            public void setLastSeriesSequenceOnly(
194:                    boolean inLastSeriesSequenceOnly) {
195:                this .lastSeriesSequenceOnly = inLastSeriesSequenceOnly;
196:            }
197:
198:            public boolean isLastSeriesSequenceOnly() {
199:                return this .lastSeriesSequenceOnly;
200:            }
201:
202:            //
203:            public void setListOrderAscending(boolean inListOrderAscending) {
204:                this .listOrderAscending = inListOrderAscending;
205:            }
206:
207:            public boolean isListOrderAscending() {
208:                return this .listOrderAscending;
209:            }
210:
211:            //
212:            public void setStartRow(int inStartRow) {
213:                this .startRow = inStartRow;
214:            }
215:
216:            public int getStartRow() {
217:                return this .startRow;
218:            }
219:
220:            //
221:            public void setQuerySize(int inQuerySize) {
222:                this .querySize = inQuerySize;
223:            }
224:
225:            public int getQuerySize() {
226:                return this .querySize;
227:            }
228:
229:            //
230:            public void setResults(SystemResultSet inWrs) {
231:                this .results = inWrs;
232:            }
233:
234:            public SystemResultSet getResults() {
235:                return this .results;
236:            }
237:
238:            //
239:            public String getOrderByName() {
240:                return this .orderByName;
241:            }
242:
243:            public Integer getOrderByType() {
244:                return this .orderByType;
245:            }
246:
247:            public CreateStatement getOrderByTable() {
248:                return this .orderByTable;
249:            }
250:
251:            //
252:            //public void setWorkflowResultSet(WorkflowResultSet inWrs) {
253:            //    this.wrs = inWrs;
254:            //}
255:            //public WorkflowResultSet getWorkflowResultSet() {
256:            //    return this.wrs;
257:            //}
258:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.