KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > extractor > sql > DefaultSqlFactory


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.extractor.sql;
24
25 import java.util.List JavaDoc;
26
27 import org.xquark.extractor.algebra.Expression;
28 import org.xquark.extractor.algebra.ExternalVariable;
29 import org.xquark.jdbc.typing.DbType;
30
31 abstract public class DefaultSqlFactory implements SqlFactory {
32     private static final String JavaDoc RCSRevision = "$Revision: 1.5 $";
33     private static final String JavaDoc RCSName = "$Name: $";
34
35     protected DefaultSqlFactory() {
36     }
37
38     public SqlAttributeExpression createAttributeExpression() {
39         return new SqlAttributeExpression();
40     }
41
42     public SqlAttributeExpression createAttributeExpression(String JavaDoc tableInstance, String JavaDoc attribute) {
43         return new SqlAttributeExpression(tableInstance, attribute);
44     }
45
46     public SqlBinOpArithmetic createBinOpArithmetic() {
47         return new SqlBinOpArithmetic();
48     }
49
50     public SqlBinOpArithmetic createBinOpArithmetic(int operator, SqlExpression leftOperand, SqlExpression rightOperand) {
51         return new SqlBinOpArithmetic(operator, leftOperand, rightOperand);
52     }
53
54     public SqlBinOpBoolean createBinOpBoolean() {
55         return new SqlBinOpBoolean();
56     }
57
58     public SqlBinOpBoolean createBinOpBoolean(int operator, SqlExpression leftOperand, SqlExpression rightOperand) {
59         return new SqlBinOpBoolean(operator, leftOperand, rightOperand);
60     }
61
62     public SqlBinOpCompare createBinOpCompare() {
63         return new SqlBinOpCompare();
64     }
65
66     public SqlBinOpCompare createBinOpCompare(int operator, SqlExpression leftOperand, SqlExpression rightOperand) {
67         return new SqlBinOpCompare(operator, leftOperand, rightOperand);
68     }
69
70     public SqlBinOpCompareAny createBinOpCompareAny() {
71         return new SqlBinOpCompareAny();
72     }
73
74     public SqlBinOpCompareAny createBinOpCompareAny(int operator, SqlExpression leftOperand, SqlExpression rightOperand) {
75         return new SqlBinOpCompareAny(operator, leftOperand, rightOperand);
76     }
77
78     public SqlBinOpLike createBinOpLike() {
79         return new SqlBinOpLike();
80     }
81
82     public SqlBinOpLike createBinOpLike(SqlExpression leftOperand, SqlExpression rightOperand, boolean not) {
83         return new SqlBinOpLike(leftOperand, rightOperand, not);
84     }
85
86     public SqlBinOpUnion createBinOpUnion() {
87         return new SqlBinOpUnion();
88     }
89
90     public SqlBinOpUnion createBinOpUnion(int operator, SqlExpression leftOperand, SqlExpression rightOperand) {
91         return new SqlBinOpUnion( operator, leftOperand, rightOperand);
92     }
93
94     abstract public SqlConvert createConvert();
95     
96     abstract public SqlConvert createConvert(SqlExpression expr, DbType originalType, DbType targetType);
97
98     public SqlIfThenElse createIfThenElse() {
99         return new SqlIfThenElse();
100     }
101
102     public SqlIfThenElse createIfThenElse(SqlExpression iif, SqlExpression tthen, SqlExpression eslse) {
103         return new SqlIfThenElse(iif, tthen, eslse);
104     }
105
106     public SqlJoin createJoin() {
107         return new SqlJoin();
108     }
109
110     public SqlJoin createJoin(List JavaDoc operandList) {
111         return new SqlJoin(operandList);
112     }
113
114     public SqlOuterJoinPredicate createOuterJoinPredicate() {
115         return new SqlOuterJoinPredicate();
116     }
117
118     public SqlOuterJoinPredicate createOuterJoinPredicate(SqlExpression predicate,SqlRenameRelation innerTable) {
119         return new SqlOuterJoinPredicate(predicate, innerTable);
120     }
121
122     public SqlUnOpExists createUnOpExists() {
123         return new SqlUnOpExists();
124     }
125
126     public SqlUnOpExists createUnOpExists(SqlExpression query, boolean notExists) {
127         return new SqlUnOpExists(query, notExists);
128     }
129
130     public SqlUnOpIsNull createUnOpIsNull() {
131         return new SqlUnOpIsNull();
132     }
133
134     public SqlUnOpIsNull createUnOpIsNull(SqlExpression expr, boolean notIsNull) {
135         return new SqlUnOpIsNull(expr, notIsNull);
136     }
137
138     public SqlUnOpMinus createUnOpMinus() {
139         return new SqlUnOpMinus();
140     }
141
142     public SqlUnOpMinus createUnOpMinus(SqlExpression expr) {
143         return new SqlUnOpMinus(expr);
144     }
145
146     public SqlUnOpNot createUnOpNot() {
147         return new SqlUnOpNot();
148     }
149
150     public SqlUnOpNot createUnOpNot(SqlExpression expr) {
151         return new SqlUnOpNot(expr);
152     }
153
154     public SqlFunAggregate createFunAggregate() {
155         return new SqlFunAggregate();
156     }
157
158     public SqlFunAggregate createFunAggregate(int operator, SqlExpression operand, boolean distinct) {
159         return new SqlFunAggregate(operator, operand, distinct);
160     }
161
162     public SqlBinOpIn createBinOpIn() {
163         return new SqlBinOpIn();
164     }
165
166     public SqlBinOpIn createBinOpIn(SqlExpression leftOperand, SqlExpression rightOperand) {
167         return new SqlBinOpIn(leftOperand, rightOperand);
168     }
169
170     public SqlPlaceHolder createPlaceHolder(ExternalVariable externalVariable) {
171         return new SqlPlaceHolder(externalVariable);
172     }
173     
174     public SqlLitBoolean createLitBoolean() {
175         return new SqlLitBoolean();
176     }
177
178     public SqlLitBoolean createLitBoolean(Boolean JavaDoc value) {
179         return new SqlLitBoolean(value);
180     }
181
182     public SqlLitDate createLitDate() {
183         return new SqlLitDate();
184     }
185
186     public SqlLitDate createLitDate(java.sql.Date JavaDoc value) {
187         return new SqlLitDate(value);
188     }
189
190     public SqlLitDecimal createLitDecimal() {
191         return new SqlLitDecimal();
192     }
193
194     public SqlLitDecimal createLitDecimal(java.math.BigDecimal JavaDoc value) {
195         return new SqlLitDecimal(value);
196     }
197
198     public SqlLitDouble createLitDouble() {
199         return new SqlLitDouble();
200     }
201
202     public SqlLitDouble createLitDouble(Double JavaDoc value) {
203         return new SqlLitDouble(value);
204     }
205
206     public SqlLitFloat createLitFloat() {
207         return new SqlLitFloat();
208     }
209
210     public SqlLitFloat createLitFloat(Float JavaDoc value) {
211         return new SqlLitFloat(value);
212     }
213
214     public SqlLitInteger createLitInteger() {
215         return new SqlLitInteger();
216     }
217
218     public SqlLitInteger createLitInteger(Integer JavaDoc value) {
219         return new SqlLitInteger(value);
220     }
221
222     public SqlLitString createLitString() {
223         return new SqlLitString();
224     }
225
226     public SqlLitString createLitString(String JavaDoc value) {
227         return new SqlLitString(value);
228     }
229
230     public SqlLitList createLitList() {
231         return new SqlLitList();
232     }
233
234     public SqlLitList createLitList(List JavaDoc litList) {
235         return new SqlLitList(litList);
236     }
237
238     public SqlLitNull createLitNull() {
239         return new SqlLitNull();
240     }
241
242     public SqlSelect createSelect(Expression expr) {
243         return new SqlSelect(expr);
244     }
245
246     public SqlSortSpecification createSortSpecification() {
247         return new SqlSortSpecification();
248     }
249
250     public SqlSortSpecification createSortSpecification(SqlExpression sortExpression, int sortDirection) {
251         return new SqlSortSpecification(sortExpression, sortDirection);
252     }
253
254     public SqlTable createTable() {
255         return new SqlTable();
256     }
257
258     public SqlTable createTable(String JavaDoc name) {
259         return new SqlTable(name);
260     }
261
262
263     public SqlTable createTable(String JavaDoc catalogName, String JavaDoc schemaName, String JavaDoc tableName) {
264         return new SqlTable(catalogName, schemaName, tableName);
265     }
266
267     public SqlRenameItem createRenameItem() {
268         return new SqlRenameItem();
269     }
270
271     public SqlRenameItem createRenameItem(SqlExpression expr, String JavaDoc name) {
272         return new SqlRenameItem(expr, name);
273     }
274
275     public SqlRenameRelation createRenameRelation() {
276         return new SqlRenameRelation();
277     }
278
279     public SqlRenameRelation createRenameRelation(SqlExpression relation,String JavaDoc alias) {
280         return new SqlRenameRelation(relation, alias);
281     }
282
283     /* create SQL Functions*/
284     public SfAbs createSfAbs() {
285         return new SfAbs();
286     }
287
288     public SfAbs createSfAbs(SqlExpression arg0) {
289         return new SfAbs(arg0);
290     }
291
292     public SfCeiling createSfCeiling() {
293         return new SfCeiling();
294     }
295
296     public SfCeiling createSfCeiling(SqlExpression arg0) {
297         return new SfCeiling(arg0);
298     }
299
300     public SfConcat createSfConcat() {
301         return new SfConcat();
302     }
303
304     public SfConcat createSfConcat(List JavaDoc list) {
305         return new SfConcat(list);
306     }
307
308     public SfContains createSfContains() {
309         return new SfContains();
310     }
311
312     public SfContains createSfContains(SqlExpression arg0, SqlExpression arg1) {
313         return new SfContains(arg0, arg1);
314     }
315
316     public SfCurrentDateTime createSfCurrentDateTime() {
317         return new SfCurrentDateTime();
318     }
319
320
321     public SfFloor createSfFloor() {
322         return new SfFloor();
323     }
324
325     public SfFloor createSfFloor(SqlExpression arg0) {
326         return new SfFloor(arg0);
327     }
328
329     public SfLowerCase createSfLowerCase() {
330         return new SfLowerCase();
331     }
332
333     public SfLowerCase createSfLowerCase(SqlExpression arg0) {
334         return new SfLowerCase(arg0);
335     }
336
337     public SfRound createSfRound() {
338         return new SfRound();
339     }
340
341     public SfRound createSfRound(SqlExpression arg0) {
342         return new SfRound(arg0);
343     }
344
345     public SfSign createSfSign() {
346         return new SfSign();
347     }
348
349     public SfSign createSfSign(SqlExpression arg0) {
350         return new SfSign(arg0);
351     }
352
353     public SfStringLength createSfStringLength() {
354         return new SfStringLength();
355     }
356
357     public SfStringLength createSfStringLength(SqlExpression arg0) {
358         return new SfStringLength(arg0);
359     }
360
361     public SfSubString createSfSubString() {
362         return new SfSubString();
363     }
364
365     public SfSubString createSfSubString(SqlExpression arg0, SqlExpression arg1) {
366         return new SfSubString(arg0, arg1);
367     }
368
369     public SfTrim createSfTrim() {
370         return new SfTrim();
371     }
372
373     public SfTrim createSfTrim(SqlExpression arg0) {
374         return new SfTrim(arg0);
375     }
376
377     public SfUpperCase createSfUpperCase() {
378         return new SfUpperCase();
379     }
380
381     public SfUpperCase createSfUpperCase(SqlExpression arg0) {
382         return new SfUpperCase(arg0);
383     }
384 }
385
Popular Tags