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

pack-priv Class NewInvocationNode

extends MethodCallNode
Class Inheritance
Imports
java.lang.reflect.Member, .Modifier, java.util.List, org.apache.derby.catalog.TypeDescriptor, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.services.compiler.LocalField, .MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.i18n.MessageService, org.apache.derby.iapi.services.loader.ClassInspector, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.dictionary.TableDescriptor, org.apache.derby.iapi.util.JBitSet

A NewInvocationNode represents a new object() invocation.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private boolean
Inherited from org.apache.derby.impl.sql.compile.MethodCallNode:
actualMethodReturnTypeinternalCalljavaClassNamemethodmethodNamemethodParameterTypesmethodParmsroutineInfosignature

Constructor Summary

AccessConstructor and Description
pack-priv
NewInvocationNode(String
The full package.class name of the class
javaClassName
,
List<ValueNode>
The parameter list for the constructor
params
,
boolean delimitedIdentifier, ContextManager
The context manager
cm
)

Constructor for a NewInvocationNode.

pack-priv
NewInvocationNode(TableName vtiTableFuncName, TableDescriptor tableDescriptor, List<ValueNode> params, boolean delimitedIdentifier, ContextManager cm)

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

boolean Whether or not this class is assignable to the specified class
assignableTo
(String
The java class name we want to assign to
toClassName
)

Is this class assignable to the specified class?

pack-priv JavaValueNode

Returns:

Nothing
bindExpression
(FromList
The FROM list for the query this expression is in, for binding columns.
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 expression.

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
)

Overrides org.apache.derby.impl.sql.compile.MethodCallNode.categorize.

Categorize this predicate.

protected Member

Returns:

Member The Member representing the method (or null if the method doesn't exist).
findPublicMethod
(String
The method name we are looking for
methodName
,
boolean
Whether or not the method we are looking for is static
staticMethod
)

Is this class have a public method with the specified signiture This is useful for the VTI interface where we want to see if the class has the option static method for returning the ResultSetMetaData.

pack-priv void
generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class we're generating
acb
,
MethodBuilder
The method the expression will go into
mb
)

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

Do code generation for this method call

pack-priv boolean
isBuiltinVTI()

Report whether this node represents a builtin VTI.

pack-priv void
setSingleInstantiation()

Mark this node as only needing to to a single instantiation.

Inherited from org.apache.derby.impl.sql.compile.MethodCallNode:
acceptChildrenaddParmsareParametersQueryInvariantbindParametersgenerateOneParametergenerateParametersgetCorrelationTablesgetDataTypegetFirstVarargIdxgetFullNamegetIsParamgetJavaClassNamegetMethodNamegetMethodParameterClassesgetMethodParmsgetObjectSignaturegetObjectTypeNamegetOrderableVariantTypegetParameterTypeNamegetPrimitiveSignaturegetResolvedMethodgetRoutineArgIdxgetRoutineArgIdxgetRoutineInfohasVarargsisVarargpreprocessprintSubNodesremapColumnReferencesToExpressionsresolveMethodCallsetNullParameterInfosomeParametersAreNullstripOneArrayLevelthrowNoMethodFoundtoString

Field Detail

delimitedIdentifierback to summary
private boolean delimitedIdentifier
isBuiltinVTIback to summary
private boolean isBuiltinVTI
singleInstantiationback to summary
private boolean singleInstantiation

Constructor Detail

NewInvocationNodeback to summary
pack-priv NewInvocationNode(String javaClassName, List<ValueNode> params, boolean delimitedIdentifier, ContextManager cm) throws StandardException

Constructor for a NewInvocationNode. Parameters are:

Parameters
javaClassName:String

The full package.class name of the class

params:List<ValueNode>

The parameter list for the constructor

cm:ContextManager

The context manager

Exceptions
StandardException:
Thrown on error
NewInvocationNodeback to summary
pack-priv NewInvocationNode(TableName vtiTableFuncName, TableDescriptor tableDescriptor, List<ValueNode> params, boolean delimitedIdentifier, ContextManager cm) throws StandardException

Method Detail

assignableToback to summary
protected boolean assignableTo(String toClassName) throws StandardException

Is this class assignable to the specified class? This is useful for the VTI interface where we want to see if the class implements java.sql.ResultSet.

Parameters
toClassName:String

The java class name we want to assign to

Returns:boolean

boolean Whether or not this class is assignable to the specified class

Exceptions
StandardException:
Thrown on error
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 expression. This means binding the sub-expressions, as well as figuring out what the return type is for this expression.

Parameters
fromList:FromList

The FROM list for the query this expression is in, for binding columns.

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

Nothing

Exceptions
StandardException:
Thrown on error
categorizeback to summary
pack-priv boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException

Overrides org.apache.derby.impl.sql.compile.MethodCallNode.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.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
findPublicMethodback to summary
protected Member findPublicMethod(String methodName, boolean staticMethod) throws StandardException

Is this class have a public method with the specified signiture This is useful for the VTI interface where we want to see if the class has the option static method for returning the ResultSetMetaData.

Parameters
methodName:String

The method name we are looking for

staticMethod:boolean

Whether or not the method we are looking for is static

Returns:Member

Member The Member representing the method (or null if the method doesn't exist).

Exceptions
StandardException:
Thrown on error
generateExpressionback to summary
pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

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

Do code generation for this method call

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class we're generating

mb:MethodBuilder

The method the expression will go into

Exceptions
StandardException:
Thrown on error
isBuiltinVTIback to summary
pack-priv boolean isBuiltinVTI()

Report whether this node represents a builtin VTI.

setSingleInstantiationback to summary
pack-priv void setSingleInstantiation()

Mark this node as only needing to to a single instantiation. (We can reuse the object after newing it.)