KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression;
2
3 import java.util.*;
4
5 import com.daffodilwoods.daffodildb.server.datadictionarysystem.*;
6 import com.daffodilwoods.daffodildb.server.serversystem.*;
7 import com.daffodilwoods.daffodildb.server.sql99.*;
8 import com.daffodilwoods.daffodildb.server.sql99.common.*;
9 import com.daffodilwoods.daffodildb.server.sql99.dql.execution.*;
10 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.*;
11 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.set.*;
12 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.set.SetOperatorAbstract.*;
13 import com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression.queryspecification.*;
14 import com.daffodilwoods.daffodildb.server.sql99.dql.semanticchecker.*;
15 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*;
16 import com.daffodilwoods.daffodildb.server.sql99.token.*;
17 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
18 import com.daffodilwoods.daffodildb.utils.comparator.*;
19 import com.daffodilwoods.database.resource.*;
20 import com.daffodilwoods.database.sqlinitiator.*;
21 import com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression.orderbyclause.orderbyclause;
22 import com.daffodilwoods.daffodildb.server.sql99.dql.semanticchecker.SemanticChecker;
23
24 /**
25  * <p>Title: Intersect </p>
26  * <p>Description:
27  * This class represents Intersection of queries. It provides functionality to
28  * verify whether this set operator is semantically correct or not as well as
29  * functionality to get optimal plan. This plan helps in obtaining the resultset
30  * to retrieve the result from this set operator. It further has two options
31  * <ol>
32  * <li>All</li>
33  * <li>Distinct</li>
34  * </ol>
35  * If Intersect is mentioned then distinct is implicit.
36  * i) Let R be a row that is a duplicate of some row in T1 or of some row in T2 or both. Let
37  * m be the number of duplicates of R in T1 and let n be the number of duplicates of R in
38  * T2 where m >=0 and n >= 0
39  * ii) If DISTINCT is specified or implicit, then
40  * Case:
41  * A) If m > 0 and n > 0, then T contains exactly one duplicate of R.
42  * B) Otherwise, T contains no duplicates of R.
43  * iii) If ALL is specified, then
44  * the number of duplicates of R that T contains is the minimum of m and n.
45  * </p>
46  * <p>Copyright: Copyright (c) 2003</p>
47  * <p>Company: Daffodil S/W Ltd</p>
48  * @author SelectTeam
49  * @version 1.0
50  */

51
52 public class queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary extends SetOperatorAbstract implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter, non_joinqueryterm, Datatypes, BVEConstants, queryexpressionbody {
53    /**
54     * Represents the right query involved in set operator
55     */

56
57    public queryprimary _queryprimary0;
58    public dummyrule _Optdummyrule1;
59
60    /**
61     * Represents the option of set operator. It can be DISTINCT or ALL. It is
62     * optional. if it is not present, DISTINCT is implicit.
63     */

64
65    public setquantifier _Optsetquantifier2;
66
67    /**
68     * Represents the type of set operator. It is INTERSECTION.
69     */

70
71    public SRESERVEDWORD1206543922 _SRESERVEDWORD12065439223;
72
73    /**
74     * Represents the left query involved in set operator
75     */

76
77    public queryexpressionbody _queryexpressionbody4;
78
79    /**
80     * Returns clone of condition passed.
81     * This method is required when condition is given on a view in which set
82     * operator is present. And that condition is solvable by view. So we've to
83     * shift this condition to underlying queries of set operator so as to give
84     * result optimally. Now columns in the condition belongs to only query of
85     * left most side. So when we've to shift condition to query of right side,
86     * we've to change columns of condition according to columns of right side
87     * query.
88     * @param bve
89     * @return
90     * @throws DException
91     */

92
93
94    private booleanvalueexpression getClonedBVE(booleanvalueexpression bve) throws DException {
95       booleanvalueexpression clonedBVE = null;
96       try {
97          if (bve != null) {
98             clonedBVE = (booleanvalueexpression) bve.clone();
99             changeColumnDetails(clonedBVE.getColumnDetails(), _queryexpressionbody4.getColumnDetails(), _queryprimary0.getColumnDetails());
100          }
101       } catch (CloneNotSupportedException JavaDoc ex) {
102          throw new DException("DSE3524", null);
103       }
104       return clonedBVE;
105    }
106
107    /**
108     * Returns Execution Plan for Set Operator.
109     * Various steps are performed as under:
110     * 1) Passed Condition is cloned to pass the condition to all the query
111     * involved in the set Operator.
112     * 2) DatedFramework is cloned to pass the dated condition to all the query
113     * involved in the set Operator.
114     * 3) Order has to be shifted to both the queries involved, for this we check
115     * whether order is already adjusted or not.
116     * for example
117     * a Intersect b Intersect c
118     * Parse Tree wud be
119     * I
120     * I c
121     * a b
122     * for query 'a' we make order according to selected columns of query
123     * 'a' if Order passed is null, otherwise Order is adjusted according
124     * to columns of order passed. According to adjusted order of query 'a',
125     * we make order to be passed to query 'b'.
126     *
127     * for query 'c' order will be same as selected columns are there at
128     * top level. so for 'c' order is alreday adjusted and we do not have
129     * to make a new order.
130     * 4) In the process discussed in step 3 we also make appropriate comparator
131     * of the order.
132     *
133     * Resultant SetOperator plan contains the clone of selected columns in
134     * natural order (in the same sequence as they are specified in select list)
135     * as well as selected columns which are adjusted according to order. They
136     * both are required. Selected columns with natural order is required to
137     * retrieve the values and adjusted selected columns are required to
138     * compare the result of underlying query.
139     * Also original selected columns are passed to plan. These are required to
140     * check whether conversion of objects are required in set operators or not.
141     * Set opearator result is formed from the result of both queries, so the
142     * objects of both query must be of same datatype and size. So cloned columns
143     * contain maximum datatype and original columns contain actual data types.
144     * @param session
145     * @param bve
146     * @param datedFrameWork
147     * @param order
148     * @param cdsWithActualTableDetails
149     * @param conditionArray
150     * @return
151     * @throws DException
152     * @throws DException
153     */

154    public _TablePlan getExecutionPlan(_ServerSession session, booleanvalueexpression bve, _DatedFramework datedFrameWork, _Order order, ColumnDetails[] cdsWithActualTableDetails, ConditionArray conditionArray) throws DException, DException {
155       booleanvalueexpression clonedBVE = getClonedBVE(bve);
156       if (clonedBVE != null) {
157          cdsWithActualTableDetails = GeneralPurposeStaticClass.getCombinedCDArray(cdsWithActualTableDetails, clonedBVE.getColumnDetails());
158       }
159       ConditionArray clonedConditionArray = getClonedConditionArray(conditionArray, clonedBVE);
160       _DatedFramework clonedDatedFrameWork = getClonedDatedFrameWork(datedFrameWork);
161       int distinctOrAll = isDistinctOrAll();
162       ComparatorAndOrder comparatorAndOrder = getAdjustedSelectOrder(order, session);
163       _Order[] ordersForBothQueries = comparatorAndOrder.order;
164 /**Next 4 lines are done by Sandeep to solve problem in Union & Inersect queries */
165       _TablePlan tPlan1 = _queryexpressionbody4.getExecutionPlan(session, bve, datedFrameWork, ordersForBothQueries[0], GeneralPurposeStaticClass.getCombinedCDArray(cdsWithActualTableDetails, GeneralPurposeStaticClass.getCombinedCDArray( clonedLeftColumnDetails, clonedLeftOrderColumnDetails)), conditionArray);
166       _TablePlan tPlan2 = _queryprimary0.getExecutionPlan(session, clonedBVE, clonedDatedFrameWork, ordersForBothQueries[1], GeneralPurposeStaticClass.getCombinedCDArray(cdsWithActualTableDetails, GeneralPurposeStaticClass.getCombinedCDArray(clonedRightColumnDetails,clonedRightOrderColumnDetails)), clonedConditionArray);
167       SetOperatorPlan sop = new SetOperatorPlan(tPlan1, tPlan2, distinctOrAll, SetOperatorConstants.INTERSECT, getReferences(getAllTableDetails()), comparatorAndOrder.comparator, _queryexpressionbody4.getSelectedColumns(), _queryprimary0.getSelectedColumns(), appropriateDataTypes, appropriateSizes, ordersForBothQueries[0].getKeyColumnDetails(), ordersForBothQueries[1].getKeyColumnDetails());
168       sop.setOriginalColumnDetails(_queryexpressionbody4.getSelectedColumns(), _queryprimary0.getSelectedColumns(), ordersForBothQueries[0], ordersForBothQueries[1]);
169       return sop;
170    }
171
172    /**
173     * The clone is needed for right child as the passed parameter belong to
174     * left child.
175     * @param conditionArray
176     * @param clonedBVE
177     * @return
178     * @throws DException
179     */

180
181    private _DatedFramework getClonedDatedFrameWork(_DatedFramework datedFrameWork) throws DException {
182       try {
183          if (datedFrameWork != null) {
184             return (_DatedFramework) datedFrameWork.clone();
185          }
186       } catch (CloneNotSupportedException JavaDoc ex) {
187          throw new DException("DSE3524", null);
188       }
189       return datedFrameWork;
190    }
191
192    /**
193     * The clone is needed for right child as the passed parameter belong to
194     * left child
195     * @param conditionArray
196     * @param clonedBVE
197     * @return
198     * @throws DException
199     */

200
201    private ConditionArray getClonedConditionArray(ConditionArray conditionArray, booleanvalueexpression clonedBVE) throws DException {
202       ConditionArray clonedArray = new ConditionArray();
203       if (clonedBVE != null) {
204          clonedArray.addCondition(clonedBVE);
205       }
206       return clonedArray;
207    }
208
209    /**
210     * Returns Quantifier for Set Operator whether it is all or distinct
211     * @return
212     * @throws DException
213     */

214
215    private int isDistinctOrAll() throws DException {
216       int distinctOrAll = (_Optsetquantifier2 == null) ? SetOperatorConstants.DISTINCT
217           : ( (String JavaDoc) _Optsetquantifier2.run(null)).equalsIgnoreCase("All") ? SetOperatorConstants.ALL : SetOperatorConstants.DISTINCT;
218       return distinctOrAll;
219    }
220
221    /**
222     * It is required to obtain the order and comparator for this set operator.
223     * Order is formed on the basis of passed order and clone of columns of
224     * both queries. Clone of column is required because it may possible that
225     * selected columns may belong to view, order formed may be shifted under
226     * view. And also we need a distinction between columns above the view and
227     * columns below the view. Same columns can't remain to both sides. So clone
228     * is needed.
229     * @param order
230     * @param serverSession
231     * @return
232     * @throws DException
233     */

234
235    private ComparatorAndOrder getAdjustedSelectOrder(_Order order, _ServerSession serverSession) throws DException {
236      /*Method is rewritten by Sandeep to solve problem in INTERSECT queris involving nested VIEWS*/
237      clonedLeftOrderColumnDetails=SemanticChecker.getClonedColumns(_queryexpressionbody4.getSelectedColumns());
238      clonedRightOrderColumnDetails= SemanticChecker.getClonedColumns(_queryprimary0.getSelectedColumns());
239       return getAdjustedSelectOrder(order, clonedLeftOrderColumnDetails,clonedRightOrderColumnDetails, serverSession);
240    }
241
242    /**
243     * Initiates Semantic Checking.
244     *
245     * Order Columns checking is also done at this level. It checks that whether
246     * the order by columns are valid ie do they appear in the select list and
247     * that they belong to the fist query.
248     *
249     * It also checks Cardinality and DataTypes of the left and right queries.
250     *
251     * It initializes the maximum datatypes and sizes among the corresponding
252     * columns of both side. It is required because Set opearator result is
253     * formed from the result of both queries, so the objects of both query must
254     * be of same datatype and size.
255     *
256     * @param session
257     * @param orderClause0
258     * @return the joint references of the left and right queries
259     * @throws DException
260     */

261     public _Reference[] checkSemantic(_ServerSession session,_OrderByClause orderClause0,boolean checkUserRight,boolean checkSetOperatorPresent) throws DException {
262         _Reference[] references1 = _queryexpressionbody4.checkSemantic(session,null,checkUserRight,true);
263         _Reference[] references2 = _queryprimary0.checkSemantic(session,null,checkUserRight,true); // Order is Not Valid In Case of 2nd Query
264
_Reference[] references = GeneralPurposeStaticClass.getJointReferences(references1, references2);
265         ColumnDetails[] columnDetails1 = _queryexpressionbody4.getSelectedColumns();
266         ColumnDetails[] columnDetails2 = _queryprimary0.getSelectedColumns();
267         SemanticChecker.checkCardinalityAndDataTypeComptability(columnDetails1, columnDetails2 );
268
269
270         /**
271          * Due to Exception in checkCardinalityAndDatatypeCompatibility when one side column is null ,
272          * Following two lines are shifted here. Compiere views was main issue. -- Manoj Kr. Sheoran
273          */

274
275         clonedLeftColumnDetails = SemanticChecker.getClonedColumns(columnDetails1);
276         clonedRightColumnDetails = SemanticChecker.getClonedColumns(columnDetails2);
277
278
279         if(references==null){
280            initializeAppropriateDataTypeAndSize();
281            if (orderClause0 != null) {
282               ColumnDetails[] orderKeyColDetails = orderClause0.getKeyColumnDetails();
283               SemanticChecker.checkingForOrder(orderKeyColDetails);
284               SemanticChecker.checkSemanticCheckingForOrderInSetOperators(columnDetails1, orderClause0.getKeyColumnDetails());
285            }
286         }
287       return references;
288    }
289
290
291    /**
292     * It delegates call of initializing data type and size to underlying queries.
293     * @param appropriateDataTypes0
294     * @param appropriateSizes0
295     * @returns true if union exists in hierarchy otherwise false.
296     * @throws DException
297     */

298
299    private boolean deligateCall(int[] appropriateDataTypes0, int[] appropriateSizes0) throws DException {
300       boolean result = false;
301       if (_queryexpressionbody4 instanceof queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryterm) {
302          result = ( (queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryterm) _queryexpressionbody4).initializeDataTypeAndSize(appropriateDataTypes0, appropriateSizes0);
303       } else if (_queryexpressionbody4 instanceof queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary) {
304          result = ( (queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary) _queryexpressionbody4).initializeDataTypeAndSize(appropriateDataTypes0, appropriateSizes0);
305       }
306       if (_queryprimary0 instanceof queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryterm) {
307          ( (queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryterm) _queryprimary0).initializeDataTypeAndSize(appropriateDataTypes0, appropriateSizes0);
308       } else if (_queryprimary0 instanceof queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary) {
309          ( (queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary) _queryprimary0).initializeDataTypeAndSize(appropriateDataTypes0, appropriateSizes0);
310       }
311       return result;
312    }
313
314    /**
315     * This method initializes the DataType and Sizes according to thoes that
316     * are passed to it. If union is present in hierarchy of setoperators, then
317     * these maximum datatypes and sizes are also set into column details.
318     * select a_int from A
319     * union
320     * select a_float from B
321     * union
322     * select a_small_int from C
323     * @param appropriateDataTypes0
324     * @param appropriateSizes0
325     * @return
326     * @throws DException
327     */

328    public boolean initializeDataTypeAndSize(int[] appropriateDataTypes0, int[] appropriateSizes0) throws DException {
329       appropriateDataTypes = appropriateDataTypes0;
330       appropriateSizes = appropriateSizes0;
331       boolean b = deligateCall(appropriateDataTypes0, appropriateSizes0);
332       if (b) {
333          for (int i = 0; i < clonedLeftColumnDetails.length; i++) {
334             clonedLeftColumnDetails[i].setDatatype(appropriateDataTypes0[i]);
335             clonedRightColumnDetails[i].setDatatype(appropriateDataTypes0[i]);
336             clonedLeftColumnDetails[i].setSize(appropriateSizes0[i]);
337             clonedRightColumnDetails[i].setSize(appropriateSizes0[i]);
338          }
339       }
340       return b;
341    }
342
343    public String JavaDoc toString() {
344       StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
345       sb.append(" ");
346       sb.append(_queryexpressionbody4);
347       sb.append(" ");
348       sb.append(_SRESERVEDWORD12065439223);
349       sb.append(" ");
350       if (_Optsetquantifier2 != null) {
351          sb.append(_Optsetquantifier2);
352       }
353       sb.append(" ");
354       if (_Optdummyrule1 != null) {
355          sb.append(_Optdummyrule1);
356       }
357       sb.append(" ");
358       sb.append(_queryprimary0);
359       return sb.toString();
360    }
361
362    public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
363       queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary tempClass = new queryexpressionbodySRESERVEDWORD1206543922OptsetquantifierOptdummyrulequeryprimary();
364       tempClass._queryprimary0 = (queryprimary) _queryprimary0.clone();
365       if (_Optdummyrule1 != null) {
366          tempClass._Optdummyrule1 = (dummyrule) _Optdummyrule1.clone();
367       }
368       if (_Optsetquantifier2 != null) {
369          tempClass._Optsetquantifier2 = (setquantifier) _Optsetquantifier2.clone();
370       }
371       tempClass._SRESERVEDWORD12065439223 = (SRESERVEDWORD1206543922) _SRESERVEDWORD12065439223.clone();
372       tempClass._queryexpressionbody4 = (queryexpressionbody) _queryexpressionbody4.clone();
373       return tempClass;
374    }
375
376    /**
377     * It allows user to obtain order and its comparator for both queries when
378     * no order is present on this set operator. But to solve this set operator,
379     * selected columns needs to be in order. Order contains the selected column
380     * in the same sequence as they are present in select list.
381     * @param columnDetailsLeft - columns of left query.
382     * @param columnDetailsRight - columns of right query.
383     * @param serverSession
384     * @param columnOrder - represents the orderspecification of order.
385     * @return order and its comparator.
386     * @throws DException
387     */

388    public ComparatorAndOrder getComparatorAndOrderForNormalOrder(ColumnDetails[] columnDetailsLeft, ColumnDetails[] columnDetailsRight, _ServerSession serverSession, boolean[] columnOrder) throws DException {
389       SuperComparator appropriateLeftSuperComparator = getComparableComparator(columnDetailsLeft, columnDetailsRight, columnOrder, serverSession);
390       _Order leftQueryOrder = new SelectOrder(columnDetailsLeft, columnOrder, null);
391       SuperComparator appropriateRightSuperComparator = null;
392       _Order rightQueryOrder = new SelectOrder(columnDetailsRight, columnOrder, appropriateRightSuperComparator);
393       return new ComparatorAndOrder(appropriateLeftSuperComparator, new _Order[] {leftQueryOrder, rightQueryOrder});
394    }
395
396    /**
397     * It allows user to obtain order and its comparator for both queries when
398     * order is present on this set operator. And the order is arranged so as to
399     * get all the selected columns to be involved in this order. It is required
400     * to obtain their result optimally.
401     * @param columnDetailsLeft - columns of left query.
402     * @param columnDetailsRight - columns of right query.
403     * @param serverSession
404     * @param columnOrder - represents the orderspecification of order.
405     * @return order and its comparator.
406     * @throws DException
407     */

408
409    public ComparatorAndOrder getComparatorAndOrderForRearrangedOrder(ColumnDetails[] columnDetailsLeft, ColumnDetails[] columnDetailsRight, _ServerSession serverSession, boolean[] orderSpecifications) throws DException {
410       SuperComparator appropriateLeftSuperComparator = getComparableComparator(columnDetailsLeft, columnDetailsRight, orderSpecifications, serverSession);
411       _Order derivedOrderLeft = new SelectOrder(columnDetailsLeft, orderSpecifications, null, true);
412       _Order derivedOrderRight = new SelectOrder(columnDetailsRight, orderSpecifications, null, true);
413       return new ComparatorAndOrder(appropriateLeftSuperComparator, new _Order[] {derivedOrderLeft, derivedOrderRight});
414    }
415
416    /**
417     * It allows user to obtain order and its comparator for both queries when
418     * order is present on this set operator. And the order is already adjusted
419     * according to the selected columns. It is the case when setoperator is left
420     * child of set operator. In that case topmost setoperator perform the
421     * adjustment of selected column, so in this case only the selected column of
422     * right child of underlying set operator needs to be adjusted acc. to order.
423     * @param columnDetailsLeft - columns of left query.
424     * @param columnDetailsRight - columns of right query.
425     * @param serverSession
426     * @param columnOrder - represents the orderspecification of order.
427     * @return order and its comparator.
428     * @throws DException
429     */

430    public ComparatorAndOrder getComparatorAndOrderForAlreadyAdjustedOrder(_Order order, ColumnDetails[] columnDetailsLeft, ColumnDetails[] columnDetailsRight, _ServerSession serverSession, boolean[] orderSpecifications) throws DException {
431       _Order derivedOrderRight = new SelectOrder(columnDetailsRight, orderSpecifications, null, true);
432       try {
433          return new ComparatorAndOrder(getComparableComparator(order.getKeyColumnDetails(), columnDetailsRight, orderSpecifications, serverSession), new _Order[] {order, derivedOrderRight});
434       } catch (DException ex) {
435          throw ex;
436       }
437    }
438 /*
439    protected SuperComparator getAppropriateSuperComparator(ColumnDetails[] leftColumns, ColumnDetails[] rightColumns, boolean[] orderSpecifications, _ServerSession serverSession) throws DException {
440       for (int i = 0, length = leftColumns.length; i < length; i++) {
441          boolean isComparable = false;
442          try {
443             isComparable = leftColumns[i].canUseByteComparison() && rightColumns[i].canUseByteComparison()
444                 ? Check.checkForComparable(leftColumns[i].getDatatype(), rightColumns[i].getDatatype())
445                 : false;
446          } catch (DException ex) {
447             throw ex;
448          }
449          if (!isComparable) {
450             return getSuperComparator(orderSpecifications, leftColumns);
451          }
452       }
453       return getComparableComparator(leftColumns, rightColumns, orderSpecifications, serverSession);
454    }
455    private SuperComparator getSuperComparator(boolean[] orderSpecifications, ColumnDetails[] leftColumns) throws DException {
456       int length = leftColumns.length;
457       SuperComparator[] superComparators = new SuperComparator[length];
458       for (int i = 0; i < length; i++) {
459          superComparators[i] = new CPsefsDpnqbsbups(new CPckfduDpnqbsbups(), orderSpecifications[i]);
460       }
461       return new CKpjoDpnqbsbups(superComparators);
462    }
463    */

464
465    /**
466     * Columns of left most query are returned
467     * @return Columns of LeftMost Query
468     * @throws DException
469     */

470
471    public ColumnDetails[] getSelectedColumns() throws DException {
472       return clonedLeftColumnDetails;
473    }
474
475    /**
476      * For documentation of following methods refer to documentation of
477      * queryexpressionbody.
478      * @return
479      * @throws DException
480      */

481
482    public _Reference[] getReferences(TableDetails[] tableDetails) throws DException {
483       _Reference[] first = _queryexpressionbody4.getReferences(tableDetails);
484       _Reference[] second = _queryprimary0.getReferences(tableDetails);
485       return GeneralPurposeStaticClass.getJointReferences(first, second);
486    }
487
488    public ColumnDetails[] getColumnDetails() throws DException {
489       ColumnDetails firstlistOfColumns[] = _queryexpressionbody4.getColumnDetails();
490       ColumnDetails secondlistOfColumns[] = _queryprimary0.getColumnDetails();
491       return GeneralPurposeStaticClass.getCombinedCDArray(firstlistOfColumns, secondlistOfColumns);
492    }
493
494    public Object JavaDoc[] getParameters(Object JavaDoc object) throws DException {
495       Object JavaDoc[] first = _queryexpressionbody4.getParameters(object);
496       Object JavaDoc[] second = _queryprimary0.getParameters(object);
497       return GeneralPurposeStaticClass.getCombinedArray(first, second);
498    }
499
500    public void getColumnsIncluded(ArrayList aList) throws DException {
501       _queryexpressionbody4.getColumnsIncluded(aList);
502       _queryprimary0.getColumnsIncluded(aList);
503    }
504
505    public ParameterInfo[] getParameterInfo() throws DException {
506       ParameterInfo[] info1 = _queryexpressionbody4.getParameterInfo();
507       ParameterInfo[] info2 = _queryprimary0.getParameterInfo();
508       return GeneralPurposeStaticClass.getCombinedParameterInfoArray(info1, info2);
509    }
510
511    public void getTablesIncluded(ArrayList aList) throws DException {
512       _queryexpressionbody4.getTablesIncluded(aList);
513       _queryprimary0.getTablesIncluded(aList);
514    }
515
516    /**
517     * All the following method delegates the call to first query. For
518     * documentation of these method refer to queryexpressionbody.
519     */

520
521    public void setDefaultValues(_VariableValueOperations variableValueOperation) throws DException {
522       _queryexpressionbody4.setDefaultValues(variableValueOperation);
523    }
524
525    public _ColumnCharacteristics getColumnCharacteristics(Object JavaDoc object) throws DException {
526       return _queryexpressionbody4.getColumnCharacteristics(object);
527    }
528
529    public TableDetails[] getAllTableDetails() throws com.daffodilwoods.database.resource.DException {
530       return GeneralPurposeStaticClass.getJointTableDetails(_queryexpressionbody4.getAllTableDetails(), _queryprimary0.getAllTableDetails());
531    }
532
533   public boolean hasConstantSelectedColumn(booleanvalueexpression bve) throws DException {
534     return _queryexpressionbody4.hasConstantSelectedColumn(bve) || _queryprimary0.hasConstantSelectedColumn(bve);
535   }
536
537    public void initializeAppropriateDataTypeAndSizeWithOrderBy(orderbyclause orderClause0) throws DException {
538       initializeAppropriateDataTypeAndSize();
539       if (orderClause0 != null) {
540          ColumnDetails[] orderKeyColDetails = orderClause0.getKeyColumnDetails();
541          SemanticChecker.checkingForOrder(orderKeyColDetails);
542          SemanticChecker.checkSemanticCheckingForOrderInSetOperators(_queryexpressionbody4.getSelectedColumns(), orderClause0.getKeyColumnDetails());
543       }
544    }
545 }
546
Popular Tags