Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql.compile
Class GroupByList  view GroupByList download GroupByList.java

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.QueryTreeNodeVector
          extended byorg.apache.derby.impl.sql.compile.OrderedColumnList
              extended byorg.apache.derby.impl.sql.compile.GroupByList
All Implemented Interfaces:
org.apache.derby.iapi.sql.compile.Visitable

public class GroupByList
extends OrderedColumnList

A GroupByList represents the list of expressions in a GROUP BY clause in a SELECT statement.


Field Summary
(package private)  int numGroupingColsAdded
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset
 
Constructor Summary
GroupByList()
           
 
Method Summary
 void addGroupByColumn(GroupByColumn column)
          Add a column to the list
 void addNewGroupingColumnsToRCL(SelectNode selectNode)
          Add any grouping columns which are not already in the appropriate RCL to the RCL.
 void bindGroupByColumns(SelectNode select, java.util.Vector aggregateVector)
          Bind the group by list.
 GroupByColumn containsColumnReference(ColumnReference cr)
           
 GroupByColumn getGroupByColumn(int position)
          Get a column from the list
 int getNumNeedToAddGroupingCols()
          Get the number of grouping columns that need to be added to the SELECT list.
 void printSubNodes(int depth)
          Print the list.
 void remapColumnReferencesToExpressions()
          Remap all ColumnReferences in this tree to be clones of the underlying expression.
 java.lang.String toString()
          Print it out, baby
 void verifyUniqueGroupingColumns()
          Check the uniqueness of the column names within a GROUP BY list.
 
Methods inherited from class org.apache.derby.impl.sql.compile.OrderedColumnList
accept, addElement, destructiveAppend, elementAt, getColumnOrdering, indexOf, insertElementAt, nondestructiveAppend, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generate, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numGroupingColsAdded

int numGroupingColsAdded
Constructor Detail

GroupByList

public GroupByList()
Method Detail

addGroupByColumn

public void addGroupByColumn(GroupByColumn column)
Add a column to the list


getGroupByColumn

public GroupByColumn getGroupByColumn(int position)
Get a column from the list


printSubNodes

public void printSubNodes(int depth)
Print the list.

Overrides:
printSubNodes in class QueryTreeNode

getNumNeedToAddGroupingCols

public int getNumNeedToAddGroupingCols()
Get the number of grouping columns that need to be added to the SELECT list.


bindGroupByColumns

public void bindGroupByColumns(SelectNode select,
                               java.util.Vector aggregateVector)
                        throws org.apache.derby.iapi.error.StandardException
Bind the group by list. Verify: o Number of grouping columns matches number of non-aggregates in SELECT's RCL. o Names in the group by list are unique o Names of grouping columns match names of non-aggregate expressions in SELECT's RCL.


verifyUniqueGroupingColumns

public void verifyUniqueGroupingColumns()
                                 throws org.apache.derby.iapi.error.StandardException
Check the uniqueness of the column names within a GROUP BY list.


addNewGroupingColumnsToRCL

public void addNewGroupingColumnsToRCL(SelectNode selectNode)
                                throws org.apache.derby.iapi.error.StandardException
Add any grouping columns which are not already in the appropriate RCL to the RCL. NOTE: The RC/VCNs in the SELECT list will point to the same pool of ResultColumns as the GroupByColumns in this list.


containsColumnReference

public GroupByColumn containsColumnReference(ColumnReference cr)

remapColumnReferencesToExpressions

public void remapColumnReferencesToExpressions()
                                        throws org.apache.derby.iapi.error.StandardException
Remap all ColumnReferences in this tree to be clones of the underlying expression.


toString

public java.lang.String toString()
Print it out, baby

Overrides:
toString in class QueryTreeNodeVector