KickJava   Java API By Example, From Geeks To Geeks.

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


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 interface SqlFactory {
32
33
34
35     public SqlAttributeExpression createAttributeExpression();
36
37     public SqlAttributeExpression createAttributeExpression(String JavaDoc tableInstance, String JavaDoc attribute);
38
39     public SqlBinOpArithmetic createBinOpArithmetic();
40
41     public SqlBinOpArithmetic createBinOpArithmetic(int operator, SqlExpression leftOperand, SqlExpression rightOperand);
42
43     public SqlBinOpBoolean createBinOpBoolean();
44
45     public SqlBinOpBoolean createBinOpBoolean(int operator, SqlExpression leftOperand, SqlExpression rightOperand);
46
47     public SqlBinOpCompare createBinOpCompare();
48
49     public SqlBinOpCompare createBinOpCompare(int operator, SqlExpression leftOperand, SqlExpression rightOperand);
50
51     public SqlBinOpCompareAny createBinOpCompareAny() ;
52
53     public SqlBinOpCompareAny createBinOpCompareAny(int operator, SqlExpression leftOperand, SqlExpression rightOperand);
54
55     public SqlBinOpLike createBinOpLike();
56
57     public SqlBinOpLike createBinOpLike(SqlExpression leftOperand, SqlExpression rightOperand, boolean not);
58
59     public SqlBinOpUnion createBinOpUnion();
60
61     public SqlBinOpUnion createBinOpUnion(int operator, SqlExpression leftOperand, SqlExpression rightOperand);
62
63     public SqlConvert createConvert();
64
65     public SqlConvert createConvert(SqlExpression expr, DbType originalType, DbType targetType);
66
67     public SqlPlaceHolder createPlaceHolder(ExternalVariable externalVariable);
68     
69     public SqlIfThenElse createIfThenElse();
70
71     public SqlIfThenElse createIfThenElse(SqlExpression iif, SqlExpression then, SqlExpression eslse);
72
73     public SqlJoin createJoin();
74
75     public SqlJoin createJoin(List JavaDoc operandList);
76
77     public SqlUnOpExists createUnOpExists();
78
79     public SqlUnOpExists createUnOpExists(SqlExpression query, boolean notExists);
80
81     public SqlUnOpIsNull createUnOpIsNull();
82
83     public SqlUnOpIsNull createUnOpIsNull(SqlExpression expr, boolean notIsNull);
84
85     public SqlUnOpMinus createUnOpMinus();
86
87     public SqlUnOpMinus createUnOpMinus(SqlExpression expr);
88
89     public SqlUnOpNot createUnOpNot();
90
91     public SqlUnOpNot createUnOpNot(SqlExpression expr);
92
93     public SqlFunAggregate createFunAggregate();
94
95     public SqlFunAggregate createFunAggregate(int operator, SqlExpression operand, boolean distinct);
96
97     public SqlBinOpIn createBinOpIn();
98
99     public SqlBinOpIn createBinOpIn(SqlExpression leftOperand, SqlExpression rightOperand);
100
101     public SqlLitBoolean createLitBoolean();
102
103     public SqlLitBoolean createLitBoolean(Boolean JavaDoc value);
104
105     public SqlLitDate createLitDate();
106
107     public SqlLitDate createLitDate(java.sql.Date JavaDoc value);
108
109     public SqlLitDecimal createLitDecimal();
110
111     public SqlLitDecimal createLitDecimal(java.math.BigDecimal JavaDoc value);
112
113     public SqlLitDouble createLitDouble();
114
115     public SqlLitDouble createLitDouble(Double JavaDoc value);
116
117     public SqlLitFloat createLitFloat();
118
119     public SqlLitFloat createLitFloat(Float JavaDoc value);
120
121     public SqlLitInteger createLitInteger();
122
123     public SqlLitInteger createLitInteger(Integer JavaDoc value);
124
125     public SqlLitList createLitList();
126
127     public SqlLitList createLitList(List JavaDoc litList);
128
129     public SqlLitString createLitString();
130
131     public SqlLitString createLitString(String JavaDoc value);
132
133     public SqlLitNull createLitNull();
134
135     public SqlSelect createSelect(Expression expr); // Added SR 12/08/03 because this is needed for
136
// renaming attribute expressions when creating temporary tables
137

138     public SqlSortSpecification createSortSpecification();
139
140     public SqlSortSpecification createSortSpecification(SqlExpression sortExpression, int sortDirection);
141
142     public SqlTable createTable();
143
144     public SqlTable createTable(String JavaDoc name);
145
146     public SqlTable createTable(String JavaDoc catalogName, String JavaDoc schemaName, String JavaDoc tableName);
147
148
149     public SqlRenameItem createRenameItem();
150
151     public SqlRenameItem createRenameItem(SqlExpression expr, String JavaDoc name);
152
153     public SqlRenameRelation createRenameRelation();
154
155     public SqlRenameRelation createRenameRelation(SqlExpression relation,String JavaDoc alias);
156
157     /* create SQL Functions*/
158     public SfAbs createSfAbs();
159
160     public SfAbs createSfAbs(SqlExpression arg0);
161
162     public SfCeiling createSfCeiling();
163
164     public SfCeiling createSfCeiling(SqlExpression arg0);
165
166     public SfConcat createSfConcat();
167
168     public SfConcat createSfConcat(List JavaDoc list);
169
170     public SfContains createSfContains();
171
172     public SfContains createSfContains(SqlExpression arg0, SqlExpression arg1);
173
174     public SfCurrentDateTime createSfCurrentDateTime();
175
176
177     public SfFloor createSfFloor();
178
179     public SfFloor createSfFloor(SqlExpression arg0);
180
181     public SfLowerCase createSfLowerCase();
182
183     public SfLowerCase createSfLowerCase(SqlExpression arg0);
184
185     public SfRound createSfRound();
186
187     public SfRound createSfRound(SqlExpression arg0);
188
189     public SfSign createSfSign();
190
191     public SfSign createSfSign(SqlExpression arg0);
192
193     public SfStringLength createSfStringLength();
194
195     public SfStringLength createSfStringLength(SqlExpression arg0);
196
197     public SfSubString createSfSubString();
198
199     public SfSubString createSfSubString(SqlExpression arg0, SqlExpression arg1);
200
201 // public SfToChar createSfToChar();
202
//
203
// public SfToChar createSfToChar(SqlExpression arg0);
204
//
205
// public SfToDate createSfToDate();
206
//
207
// public SfToDate createSfToDate(SqlExpression arg0, SqlExpression arg1);
208
//
209
// public SfToNumber createSfToNumber();
210
//
211
// public SfToNumber createSfToNumber(SqlExpression arg0);
212

213     public SfTrim createSfTrim();
214
215     public SfTrim createSfTrim(SqlExpression arg0);
216
217     public SfUpperCase createSfUpperCase();
218
219     public SfUpperCase createSfUpperCase(SqlExpression arg0);
220 }
221
Popular Tags