KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > queryexpression > queryexpressionbody


1 package com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression;
2
3 import com.daffodilwoods.daffodildb.server.datadictionarysystem.*;
4 import com.daffodilwoods.daffodildb.server.serversystem.*;
5 import com.daffodilwoods.daffodildb.server.sql99.common.*;
6 import com.daffodilwoods.daffodildb.server.sql99.dql.execution.*;
7 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents.*;
8 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.*;
9 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*;
10 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
11 import com.daffodilwoods.daffodildb.utils.parser.*;
12 import com.daffodilwoods.database.resource.*;
13 import com.daffodilwoods.database.sqlinitiator.*;
14 import java.util.*;
15 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.condition._BVEPlan;
16 import com.daffodilwoods.daffodildb.server.sql99.common.*;
17
18 /**
19  * It is top level interface for select query. It can be select query or simple
20  * joins. It is required to obtain all the information corresponding to select
21  * query.
22  * <p>Title: </p>
23  * <p>Description: </p>
24  * <p>Copyright: Copyright (c) 2003</p>
25  * <p>Company: </p>
26  * @author unascribed
27  * @version 1.0
28  */

29
30 public interface queryexpressionbody extends com.daffodilwoods.daffodildb.utils.parser.StatementExecuter,Parameters{
31
32    /**
33     * It is required to obtain one column per selectsublist of select list of
34     * select query. If this interface represents set operator's query,
35     * then it returns selected columns of first select query involved in set
36     * operators.
37     * @return Array of columns
38     * @throws DException
39     */

40
41    public ColumnDetails[] getSelectedColumns() throws DException ;
42
43    /**
44     * It is required to obtain all the columns involved in selectlist of select
45     * query. If this interface represents set operator's query, then it returns
46     * selected columns of first select query involved in set operators.
47     * @return Array of columns
48     * @throws DException
49     */

50
51    public ColumnDetails[] getColumnDetails()throws DException;
52
53    /**
54     * It is required to obtain a optimal plan to execute select query. Also
55     * passed condition, order also helps in formation of plan.
56     * @param session
57     * @param bve represents condition applied on this query. It is the case when
58     * condition is present on view or 'from subquery'
59     * @param datedCondition
60     * @param order represents order applied on this query. It is the case when order
61     * is present on view or 'from subquery'
62     * @param cdsWithActualTableDetails represents columns of view with viewname
63     * as tablename.
64     * @param conditionArray
65     * @return QueryExpressionPlan.
66     * @throws DException
67     */

68
69    _TablePlan getExecutionPlan(_ServerSession session,booleanvalueexpression bve,_DatedFramework datedCondition,_Order order,ColumnDetails[] cdsWithActualTableDetails, ConditionArray conditionArray) throws DException;
70
71    /**
72     * This method is required when the query is part of view definition and that
73     * view is optimizable means its definition can be merged with parent select
74     * query. Then the upward query needs the tables plans of view's query to
75     * merge it with its TablePlan.
76     * @param session
77     * @param condition applied on this query. It is the case when
78     * condition is present on view or 'from subquery'
79     * @param order represents order applied on this query. It is the case when order
80     * is present on view or 'from subquery'
81     * @param columnDetails
82     * @param conditionArray
83     * @return
84     * @throws DException
85     */

86
87    _TablePlan[] getTablePlans(_ServerSession session , booleanvalueexpression condition , _Order order , ColumnDetails columnDetails[] , ConditionArray conditionArray) throws DException ;
88
89    /**
90     * It allows user to check whether this query is semantically correct or not.
91     * The objects which are not solvable by this select query are returned. The
92     * values of these objects are to be provided by user of this query.
93     * @param session
94     * @param orderClause represents the order of this query.
95     * @param checkUserRight represents whether user rights on underlying views
96     * needs to be checked or not.
97     * @param checkSetOperatorPresent is used to ensure full text is not used
98     * with setoperators.
99     * @return the objects which are not solvable by this query.
100     * @throws DException
101     */

102
103    public _Reference[] checkSemantic(_ServerSession session,_OrderByClause orderClause,boolean checkUserRight,boolean checkSetOperatorPresent) throws DException ;
104
105    /**
106     * Returns the columns which do not belong to passed tables.
107     * @param tableDetails
108     * @return
109     * @throws DException
110     */

111
112    public _Reference[] getReferences(TableDetails[] tableDetails) throws DException;
113
114    /**
115     * It allows user to get information related to parametrs(questionmarks)
116     * present in this query.
117     * @return Array of ParameterInfo
118     * @throws DException
119     */

120
121    public ParameterInfo[] getParameterInfo() throws DException ;
122
123    /**
124     * It allows user to get characteristics of selected columns present in select
125     * query.
126     * @param object
127     * @return
128     * @throws DException
129     */

130
131    _ColumnCharacteristics getColumnCharacteristics(Object JavaDoc object) throws DException;
132
133    /**
134     * It is needed to check whether updatable resultset can be taken on this
135     * query.
136     * @return true if the query does not have where, orderby, groupby, having
137     * and union clause otherwise returns false.
138     * @throws DException
139     */

140    public boolean isSimpleQuery(_ServerSession serverSession) throws DException;
141
142    /**
143     * It is needed by DDL. It adds the name of columns in passed list.
144     * @param aList
145     * @throws DException
146     */

147    public void getColumnsIncluded(ArrayList aList)throws DException;
148
149    /**
150     * It is needed by DDL. It adds the name of tables in passed list.
151     * @param aList
152     * @throws DException
153     */

154
155    public void getTablesIncluded(ArrayList aList)throws DException;
156
157    /**
158     * Returns all the tables present in select query. If any view is
159     * specified then view's table is not included. But in place of that
160     * view, its underlying tables are included.
161     * @return
162     * @throws DException
163     */

164
165    TableDetails[] getAllTableDetails() throws DException ;
166
167    /**
168     * Returns all the top level tables present in select query. Top level
169     * tables means if view is specified then this view will be returned as a
170     * table.
171     * @return
172     * @throws DException
173     */

174
175    TableDetails[] getViewTableDetails() throws DException ;
176
177    /**
178     * This method allows the user to know whether this select query can be
179     * merged with upward select query. It is needed when view or 'from subquery'
180     * is used. View is optimizable when groupby, order by, distinct,
181     * functional columns, set operators are not present.
182     * @return
183     * @throws DException
184     */

185
186    boolean isViewOptimizationPossible() throws DException;
187
188    /**
189     * It is required by frontend for sapling. It provides user with all the
190     * information of select query in parts.
191     * @return QueryProperty
192     * @throws DException
193     */

194
195    QueryProperty getStrings() throws DException;
196
197    /**
198     * Sets the column details for Foreign key. It is required in chained column
199     * work.
200     * @param fKeyColumns
201     * @throws DException
202     */

203
204    public void setFKeyColumnDetails(ColumnDetails[] fKeyColumns) throws DException ;
205
206    /**
207     * This method is needed while insertion through resultset has to perform.
208     * Sets the tables in which insertion will also take place, despite the fact
209     * that user has not given the request of that. It is done so as to make
210     * insertion to satisfy the constructs of select query.
211     * @param parm1
212     * @param vv
213     * @throws com.daffodilwoods.database.resource.DException
214     */

215
216    void setTablesForInsertion(ColumnMappingHandler parm1, _VariableValueOperations vv) throws com.daffodilwoods.database.resource.DException ;
217
218    /**
219     * This method is needed while insertion through resultset has to perform.
220     * this method return base level table in which insertion will definitely take
221     * place.
222     * @param variableValueOperations
223     * @throws DException
224     */

225
226    TableDetails[] getTablesForBlankInsert() throws DException ;
227
228    /**
229     * This method is required during insertion/updation through resultset. It
230     * adds some default value so as to ensure that newly modified row should
231     * satisfy the constructs of select query.
232     * @param variableValueOperations
233     * @throws DException
234     */

235
236    public void setDefaultValues(_VariableValueOperations variableValueOperations) throws DException ;
237
238    /**
239     * This method is required during insertion/updation through resultset. It
240     * varifies that newly modified row satisfies the constructs of select query.
241     * @param vv
242     * @throws DException
243     */

244
245    void verifyValues(_VariableValueOperations vv ) throws DException;
246
247    /**
248     * This method is required when the query is part of view definition and that
249     * view is optimizable means its definition can be merged with parent select
250     * query. Then the upward query needs the condition plan of view's query to
251     * merge this condition plan with its condition plan.
252     * @return BvePlan
253     * @throws DException
254     */

255
256    _BVEPlan getBveExecutionPlan() throws DException;
257
258    /**
259     * This Method is reqd to check whether the query contains any other type of column than Reference or not.
260     * Needed when view's query is rewrited in Query.
261     * return true if contains any other type of column.
262     * @author Manoj Kr.
263     */

264
265    public boolean hasConstantSelectedColumn(booleanvalueexpression bve) throws DException;
266
267 }
268
Popular Tags