|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.sql.compile
Class VirtualColumnNode

java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.VirtualColumnNode
- All Implemented Interfaces:
- org.apache.derby.iapi.sql.compile.Visitable
- public class VirtualColumnNode
- extends ValueNode
A VirtualColumnNode represents a virtual column reference to a column in a row returned by an underlying ResultSetNode. The underlying column could be in a base table, view (which could expand into a complex expression), subquery in the FROM clause, temp table, expression result, etc. By the time we get to code generation, all VirtualColumnNodes should stand only for references to columns in a base table within a FromBaseTable.
| Field Summary | |
(package private) int |
columnId
|
(package private) boolean |
correlated
|
(package private) ResultColumn |
sourceColumn
|
(package private) ResultSetNode |
sourceResultSet
|
| 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 | |
VirtualColumnNode()
|
|
| Method Summary | |
void |
generateExpression(ExpressionClassBuilder acb,
org.apache.derby.iapi.services.compiler.MethodBuilder mb)
ColumnNode's are against the current row in the system. |
(package private) boolean |
getCorrelated()
Return whether or not this VCN is a correlated reference. |
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression. |
java.lang.String |
getSchemaName()
Get the name of the schema the ResultColumn's table is in, if any. |
ResultColumn |
getSourceColumn()
Return the ResultColumn that is the source of this VirtualColumnNode. |
ResultColumn |
getSourceResultColumn()
Return the ResultColumn that is the source of this VirtualColumnNode. |
ResultSetNode |
getSourceResultSet()
Return the ResultSetNode that is the source of this VirtualColumnNode. |
java.lang.String |
getTableName()
Get the name of the table the ResultColumn is in, if any. |
org.apache.derby.iapi.types.DataTypeDescriptor |
getTypeServices()
Get the DataTypeServices from this Node. |
void |
init(java.lang.Object sourceResultSet,
java.lang.Object sourceColumn,
java.lang.Object columnId)
Initializer for a VirtualColumnNode. |
boolean |
isCloneable()
Return whether or not this expression tree is cloneable. |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
(package private) void |
setCorrelated()
Mark this VCN as a reference to a correlated column. |
boolean |
updatableByCursor()
Return whether or not the ResultColumn is wirtable by a positioned update. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
sourceResultSet
ResultSetNode sourceResultSet
sourceColumn
ResultColumn sourceColumn
columnId
int columnId
correlated
boolean correlated
| Constructor Detail |
VirtualColumnNode
public VirtualColumnNode()
| Method Detail |
init
public void init(java.lang.Object sourceResultSet, java.lang.Object sourceColumn, java.lang.Object columnId)
- Initializer for a VirtualColumnNode.
- Overrides:
initin classQueryTreeNode
printSubNodes
public void printSubNodes(int depth)
- Prints the sub-nodes of this object. See QueryTreeNode.java for
how tree printing is supposed to work.
- Overrides:
printSubNodesin classQueryTreeNode
getSourceResultSet
public ResultSetNode getSourceResultSet()
- Return the ResultSetNode that is the source of this VirtualColumnNode.
getSourceColumn
public ResultColumn getSourceColumn()
- Return the ResultColumn that is the source of this VirtualColumnNode.
getTableName
public java.lang.String getTableName()
- Get the name of the table the ResultColumn is in, if any. This will be null
if the user did not supply a name (for example, select a from t).
The method will return B for this example, select b.a from t as b
The method will return T for this example, select t.a from t
- Overrides:
getTableNamein classValueNode
getSchemaName
public java.lang.String getSchemaName() throws org.apache.derby.iapi.error.StandardException
- Get the name of the schema the ResultColumn's table is in, if any.
The return value will be null if the user did not supply a schema name
(for example, select t.a from t).
Another example for null return value (for example, select b.a from t as b).
But for following query select app.t.a from t, this will return APP
- Overrides:
getSchemaNamein classValueNode
updatableByCursor
public boolean updatableByCursor()
- Return whether or not the ResultColumn is wirtable by a positioned update.
- Overrides:
updatableByCursorin classValueNode
getSourceResultColumn
public ResultColumn getSourceResultColumn()
- Return the ResultColumn that is the source of this VirtualColumnNode.
- Overrides:
getSourceResultColumnin classValueNode
setCorrelated
void setCorrelated()
- Mark this VCN as a reference to a correlated column.
(It's source resultSet is an outer ResultSet.
getCorrelated
boolean getCorrelated()
- Return whether or not this VCN is a correlated reference.
isCloneable
public boolean isCloneable()
- Return whether or not this expression tree is cloneable.
- Overrides:
isCloneablein classValueNode
generateExpression
public void generateExpression(ExpressionClassBuilder acb, org.apache.derby.iapi.services.compiler.MethodBuilder mb) throws org.apache.derby.iapi.error.StandardException
- ColumnNode's are against the current row in the system.
This lets us generate
a faster get that simply returns the column from the
current row, rather than getting the value out and
returning that, only to have the caller (in the situations
needed) stuffing it back into a new column holder object.
We will assume the general generate() path is for getting
the value out, and use generateColumn() when we want to
keep the column wrapped.
- Overrides:
generateExpressionin classValueNode
getOrderableVariantType
protected int getOrderableVariantType()
throws org.apache.derby.iapi.error.StandardException
- Return the variant type for the underlying expression.
The variant type can be:
VARIANT - variant within a scan
(method calls and non-static field access)
SCAN_INVARIANT - invariant within a scan
(column references from outer tables)
QUERY_INVARIANT - invariant within the life of a query
(constant expressions)
- Overrides:
getOrderableVariantTypein classValueNode
getTypeServices
public org.apache.derby.iapi.types.DataTypeDescriptor getTypeServices()
- Get the DataTypeServices from this Node.
- Overrides:
getTypeServicesin classValueNode
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC