Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

public final Class GetCurrentConnectionNode

extends JavaValueNode
Class Inheritance
Imports
java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.ClassName, org.apache.derby.iapi.services.classfile.VMOpcode, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.sql.compile.CompilerContext, org.apache.derby.iapi.store.access.Qualifier, org.apache.derby.iapi.util.JBitSet

This node represents a unary getCurrentConnection operator RESOLVE - parameter will always be null for now. Someday we may want to allow user to specify which of their connections they want. Assume that we will use a String.

Field Summary

Inherited from org.apache.derby.impl.sql.compile.JavaValueNode:
forCallStatementjsqlType

Constructor Summary

AccessConstructor and Description
pack-priv
GetCurrentConnectionNode(ContextManager cm)

Constructor for a GetCurrentConnectionNode

Method Summary

Modifier and TypeMethod and Description
pack-priv JavaValueNode
bindExpression(FromList
The query's FROM list
fromList
,
SubqueryList
The subquery list being built as we find SubqueryNodes
subqueryList
,
List<AggregateNode>
The aggregate list being built as we find AggregateNodes
aggregates
)

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.bindExpression.

Bind this operator

pack-priv void
bindParameter()

Bind a ?

pack-priv boolean

Returns:

boolean Whether or not source.expression is a ColumnReference or a VirtualColumnNode.
categorize
(JBitSet
JBitSet with bit map of referenced FromTables
referencedTabs
,
boolean
Whether or not to consider method calls, field references and conditional nodes when building bit map
simplePredsOnly
)

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.categorize.

Categorize this predicate.

pack-priv void
checkReliability(ValueNode sqlNode)

Overrides org.apache.derby.impl.sql.compile.JavaValueNode.checkReliability.

Check the reliability type of this java value.

pack-priv void
generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built
acb
,
MethodBuilder
The method the code to place the code
mb
)

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.generateExpression.

General logic shared by Core compilation and by the Replication Filter compiler.

pack-priv int

Returns:

The variant type for the underlying expression.
getOrderableVariantType
()

Overrides org.apache.derby.impl.sql.compile.JavaValueNode.getOrderableVariantType.

Return the variant type for the underlying expression.

pack-priv void
preprocess(int
Number of tables in the DML Statement
numTables
,
FromList
FromList from outer query block
outerFromList
,
SubqueryList
SubqueryList from outer query block
outerSubqueryList
,
PredicateList
PredicateList from outer query block
outerPredicateList
)

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.preprocess.

Preprocess an expression tree.

pack-priv JavaValueNode

Returns:

JavaValueNode The remapped expression tree.
remapColumnReferencesToExpressions
()

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.remapColumnReferencesToExpressions.

Remap all ColumnReferences in this tree to be clones of the underlying expression.

Inherited from org.apache.derby.impl.sql.compile.JavaValueNode:
castToPrimitivegenerategenerateReceivergenerateReceivergetCollationTypegetConstantValueAsObjectgetDataTypegetJavaTypeNamegetJSQLTypegetPrimitiveTypeNamegetReceiverExpressionisPrimitiveTypemapToTypeIDmarkForCallStatementmarkReturnValueDiscardedmustCastToPrimitivereturnValueDiscardedreturnValueToSQLDomainsetCollationTypesetJavaTypeNamevalueReturnedToSQLDomain

Constructor Detail

GetCurrentConnectionNodeback to summary
pack-priv GetCurrentConnectionNode(ContextManager cm)

Constructor for a GetCurrentConnectionNode

Method Detail

bindExpressionback to summary
pack-priv JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.bindExpression.

Bind this operator

Parameters
fromList:FromList

The query's FROM list

subqueryList:SubqueryList

The subquery list being built as we find SubqueryNodes

aggregates:List<AggregateNode>

The aggregate list being built as we find AggregateNodes

Returns:JavaValueNode

Doc from org.apache.derby.impl.sql.compile.JavaValueNode.bindExpression.

the new node, usually this

Exceptions
StandardException:
Thrown on error
bindParameterback to summary
pack-priv void bindParameter()

Bind a ? parameter operand of the char_length function.

categorizeback to summary
pack-priv boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly)

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.categorize.

Categorize this predicate. Initially, this means building a bit map of the referenced tables for each predicate. If the source of this ColumnReference (at the next underlying level) is not a ColumnReference or a VirtualColumnNode then this predicate will not be pushed down. For example, in: select * from (select 1 from s) a (x) where x = 1 we will not push down x = 1.

Note

It would be easy to handle the case of a constant, but if the inner SELECT returns an arbitrary expression, then we would have to copy that tree into the pushed predicate, and that tree could contain subqueries and method calls. RESOLVE - revisit this issue once we have views.

Parameters
referencedTabs:JBitSet

JBitSet with bit map of referenced FromTables

simplePredsOnly:boolean

Whether or not to consider method calls, field references and conditional nodes when building bit map

Returns:boolean

boolean Whether or not source.expression is a ColumnReference or a VirtualColumnNode.

checkReliabilityback to summary
pack-priv void checkReliability(ValueNode sqlNode) throws StandardException

Overrides org.apache.derby.impl.sql.compile.JavaValueNode.checkReliability.

Check the reliability type of this java value.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
See Also
org.apache.derby.iapi.sql.compile.CompilerContext
generateExpressionback to summary
pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.generateExpression.

Doc from org.apache.derby.impl.sql.compile.JavaValueNode.generateExpression.

General logic shared by Core compilation and by the Replication Filter compiler. Every child of ValueNode must implement one of these methods.

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class being built

mb:MethodBuilder

The method the code to place the code

Exceptions
StandardException:
Thrown on error
See Also
ConstantNode#generateExpression
getOrderableVariantTypeback to summary
pack-priv int getOrderableVariantType()

Overrides org.apache.derby.impl.sql.compile.JavaValueNode.getOrderableVariantType.

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)

Returns:int

The variant type for the underlying expression.

Annotations
@Override
preprocessback to summary
pack-priv void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.preprocess.

Preprocess an expression tree. We do a number of transformations here (including subqueries, IN lists, LIKE and BETWEEN) plus subquery flattening.

Note

This is done before the outer ResultSetNode is preprocessed.

Parameters
numTables:int

Number of tables in the DML Statement

outerFromList:FromList

FromList from outer query block

outerSubqueryList:SubqueryList

SubqueryList from outer query block

outerPredicateList:PredicateList

PredicateList from outer query block

Exceptions
StandardException:
Thrown on error
remapColumnReferencesToExpressionsback to summary
pack-priv JavaValueNode remapColumnReferencesToExpressions()

Implements abstract org.apache.derby.impl.sql.compile.JavaValueNode.remapColumnReferencesToExpressions.

Remap all ColumnReferences in this tree to be clones of the underlying expression.

Returns:JavaValueNode

JavaValueNode The remapped expression tree.