|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.ColumnReference
A ColumnReference represents a column in the query tree. The parser generates a ColumnReference for each column reference. A column refercence could be a column in a base table, a column in a view (which could expand into a complex expression), or a column in a subquery in the FROM clause.
Field Summary | |
java.lang.String |
columnName
|
int |
columnNumber
|
private int |
nestingLevel
|
(package private) int |
origColumnNumber
|
java.lang.String |
origName
|
(package private) ResultColumn |
origSource
|
(package private) int |
origTableNumber
|
private boolean |
replacesAggregate
|
ResultColumn |
source
|
private int |
sourceLevel
|
TableName |
tableName
|
int |
tableNumber
|
private int |
tokBeginOffset
|
private int |
tokEndOffset
|
Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode |
clause, dataTypeServices, IN_HAVING_CLAUSE, IN_SELECT_LIST, IN_UNKNOWN_CLAUSE, IN_WHERE_CLAUSE, transformed |
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 | |
ColumnReference()
|
Method Summary | |
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind this expression. |
boolean |
categorize(JBitSet referencedTabs,
boolean simplePredsOnly)
Categorize this predicate. |
boolean |
constantExpression(PredicateList whereClause)
Return whether or not this expression tree represents a constant value. |
void |
copyFields(ColumnReference oldCR)
Copy all of the "appropriate fields" for a shallow copy. |
void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
ColumnReference's are to the current row in the system. |
ValueNode |
getClone()
Return a clone of this node. |
java.lang.String |
getColumnName()
Get the name of this column |
int |
getColumnNumber()
Get the column number for this ColumnReference. |
(package private) boolean |
getCorrelated()
Return whether or not this CR is correlated. |
boolean |
getGeneratedToReplaceAggregate()
Determine whether or not this node was generated to replace an aggregate in the user's SELECT. |
(package private) int |
getNestingLevel()
Get the nesting level for this CR. |
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression. |
java.lang.String |
getSchemaName()
Get the user-supplied schema name of this column. |
ResultColumn |
getSource()
Get the source this columnReference |
(package private) int |
getSourceLevel()
Get the source level for this CR. |
ResultColumn |
getSourceResultColumn()
Get the source for this ValueNode. |
java.lang.String |
getSourceSchemaName()
Get the name of the schema for the Column's base table, if any. |
java.lang.String |
getSourceTableName()
Get the name of the underlying(base) table this column comes from, if any. |
java.lang.String |
getSQLColumnName()
Get the column name for purposes of error messages or debugging. |
java.lang.String |
getTableName()
Get the user-supplied table name of this column. |
TableName |
getTableNameNode()
Return the table name as the node it is. |
int |
getTableNumber()
Get the table number for this ColumnReference. |
(package private) void |
getTablesReferenced(JBitSet refs)
Update the table map to reflect the source of this CR. |
int |
getTokenBeginOffset()
Get the begin offset of the parser token for the column name Will only be set when the CR was generated by the parser. |
int |
getTokenEndOffset()
Get the end offset of the parser token for the column name. |
DataTypeDescriptor |
getTypeServices()
Get the DataTypeServices from this Node. |
void |
init(java.lang.Object columnName,
java.lang.Object tableName)
Initializer. |
void |
init(java.lang.Object columnName,
java.lang.Object tableName,
java.lang.Object tokBeginOffset,
java.lang.Object tokEndOffset)
Initializer. |
boolean |
isCloneable()
Return whether or not this expression tree is cloneable. |
void |
markGeneratedToReplaceAggregate()
Mark this node as being generated to replace an aggregate. |
(package private) boolean |
pointsToColumnReference()
Return whether or not the source of this ColumnReference is itself a ColumnReference. |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
ValueNode |
putAndsOnTop()
Do the 1st step in putting an expression into conjunctive normal form. |
void |
remapColumnReferences()
Remap all of the ColumnReferences in this expression tree to point to the ResultColumn that is 1 level under their current source ResultColumn. |
ValueNode |
remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the underlying expression. |
void |
setColumnName(java.lang.String columnName)
Set the name of this column |
(package private) void |
setNestingLevel(int nestingLevel)
Set the nesting level for this CR. |
void |
setSource(ResultColumn source)
Set the source this columnReference |
(package private) void |
setSourceLevel(int sourceLevel)
Set the source level for this CR. |
void |
setTableNameNode(TableName tableName)
|
void |
setTableNumber(int tableNumber)
Set this ColumnReference to refer to the given table number. |
java.lang.String |
toString()
Convert this object to a String. |
void |
unRemapColumnReferences()
|
boolean |
updatableByCursor()
Is the column wirtable by the cursor or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public java.lang.String columnName
public TableName tableName
public int tableNumber
public int columnNumber
public ResultColumn source
ResultColumn origSource
public java.lang.String origName
int origTableNumber
int origColumnNumber
private boolean replacesAggregate
private int nestingLevel
private int sourceLevel
private int tokBeginOffset
private int tokEndOffset
Constructor Detail |
public ColumnReference()
Method Detail |
public void init(java.lang.Object columnName, java.lang.Object tableName, java.lang.Object tokBeginOffset, java.lang.Object tokEndOffset)
init
in class QueryTreeNode
columnName
- The name of the column being referencedtableName
- The qualification for the columntokBeginOffset
- begin position of token for the column name
identifier from parser.tokEndOffset
- end position of token for the column name
identifier from parser.public void init(java.lang.Object columnName, java.lang.Object tableName)
init
in class QueryTreeNode
columnName
- The name of the column being referencedtableName
- The qualification for the columnpublic java.lang.String toString()
toString
in class ValueNode
public void printSubNodes(int depth)
printSubNodes
in class QueryTreeNode
depth
- The depth of this node in the tree
public int getTokenBeginOffset()
public int getTokenEndOffset()
boolean getCorrelated()
void setNestingLevel(int nestingLevel)
nestingLevel
- The Nesting level at which the CR appears.
int getNestingLevel()
void setSourceLevel(int sourceLevel)
sourceLevel
- The Nesting level of the source of the CR.
int getSourceLevel()
public void markGeneratedToReplaceAggregate()
public boolean getGeneratedToReplaceAggregate()
public ValueNode getClone() throws StandardException
getClone
in class ValueNode
StandardException
- Thrown on errorpublic void copyFields(ColumnReference oldCR) throws StandardException
oldCR
- The ColumnReference to copy from.
StandardException
- Thrown on errorpublic ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector) throws StandardException
bindExpression
in class ValueNode
fromList
- The FROM list for the query this
expression is in, for binding columns.subqueryList
- The subquery list being built as we find SubqueryNodesaggregateVector
- The aggregate vector being built as we find AggregateNodes
StandardException
- Thrown on errorpublic java.lang.String getSQLColumnName()
public java.lang.String getColumnName()
getColumnName
in class ValueNode
public void setColumnName(java.lang.String columnName)
public int getTableNumber()
public void setTableNumber(int tableNumber)
public java.lang.String getTableName()
getTableName
in class ValueNode
public java.lang.String getSourceTableName()
public java.lang.String getSourceSchemaName() throws StandardException
StandardException
public boolean updatableByCursor()
updatableByCursor
in class ValueNode
public TableName getTableNameNode()
public void setTableNameNode(TableName tableName)
public int getColumnNumber()
public ResultColumn getSource()
public void setSource(ResultColumn source)
source
- The source of this columnReference
public ValueNode putAndsOnTop() throws StandardException
putAndsOnTop
in class ValueNode
StandardException
- Thrown on errorpublic boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly)
categorize
in class ValueNode
referencedTabs
- JBitSet with bit map of referenced FromTablessimplePredsOnly
- Whether or not to consider method
calls, field references and conditional nodes
when building bit map
public void remapColumnReferences()
public void unRemapColumnReferences()
public ResultColumn getSourceResultColumn()
ValueNode
getSourceResultColumn
in class ValueNode
public ValueNode remapColumnReferencesToExpressions() throws StandardException
remapColumnReferencesToExpressions
in class ValueNode
StandardException
- Thrown on errorvoid getTablesReferenced(JBitSet refs)
refs
- The table map.
public boolean isCloneable()
isCloneable
in class ValueNode
public boolean constantExpression(PredicateList whereClause)
ValueNode
constantExpression
in class ValueNode
ValueNode.constantExpression(org.apache.derby.impl.sql.compile.PredicateList)
public void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression
in class ValueNode
mb
- The method the expression will go into
StandardException
- Thrown on errorpublic java.lang.String getSchemaName()
getSchemaName
in class ValueNode
protected int getOrderableVariantType()
getOrderableVariantType
in class ValueNode
boolean pointsToColumnReference()
public DataTypeDescriptor getTypeServices()
getTypeServices
in class ValueNode
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |