org.apache.derby.impl.sql.compile
Class NewInvocationNode

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.JavaValueNode
          extended byorg.apache.derby.impl.sql.compile.MethodCallNode
              extended byorg.apache.derby.impl.sql.compile.NewInvocationNode
All Implemented Interfaces:
Visitable

public class NewInvocationNode
extends MethodCallNode

A NewInvocationNode represents a new object() invocation.

Author:
Jerry Brenner

Field Summary
private  boolean delimitedIdentifier
           
private  boolean singleInstantiation
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.MethodCallNode
actualMethodReturnType, internalCall, javaClassName, method, methodName, methodParameterTypes, methodParms, routineInfo, signature
 
Fields inherited from class org.apache.derby.impl.sql.compile.JavaValueNode
forCallStatement, jsqlType
 
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
NewInvocationNode()
           
 
Method Summary
protected  boolean assignableTo(java.lang.String toClassName)
          Is this class assignable to the specified class?
 JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector)
          Bind this expression.
 boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly)
          Categorize this predicate.
protected  java.lang.reflect.Member findPublicMethod(java.lang.String methodName, boolean 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.
 void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
          Do code generation for this method call
(package private)  void getCorrelationTables(JBitSet correlationMap)
          Build a JBitSet of all of the tables that we are correlated with.
 java.lang.Class[] getMethodParameterClasses()
          Get the resolved Classes of our parameters
 void init(java.lang.Object javaClassName, java.lang.Object params, java.lang.Object delimitedIdentifier)
          Initializer for a NewInvocationNode
(package private)  void setSingleInstantiation()
          Mark this node as only needing to to a single instantiation.
 
Methods inherited from class org.apache.derby.impl.sql.compile.MethodCallNode
accept, addParms, addParms, areParametersQueryInvariant, bindParameters, generateOneParameter, generateParameters, getIsParam, getJavaClassName, getMethodName, getMethodParms, getObjectSignature, getOrderableVariantType, getParameterTypeName, getPrimitiveSignature, getSignature, init, preprocess, printSubNodes, remapColumnReferencesToExpressions, resolveMethodCall, setClause, setNullParameterInfo, someParametersAreNull, throwNoMethodFound, toString
 
Methods inherited from class org.apache.derby.impl.sql.compile.JavaValueNode
castToPrimitive, checkReliability, generate, generateReceiver, generateReceiver, getConstantValueAsObject, getJavaTypeName, getJSQLType, getPrimitiveTypeName, getReceiverExpression, isPrimitiveType, mapToTypeID, markForCallStatement, markReturnValueDiscarded, mustCastToPrimitive, returnValueDiscarded, returnValueToSQLDomain, setJavaTypeName, valueReturnedToSQLDomain
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, 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, 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

singleInstantiation

private boolean singleInstantiation

delimitedIdentifier

private boolean delimitedIdentifier
Constructor Detail

NewInvocationNode

public NewInvocationNode()
Method Detail

init

public void init(java.lang.Object javaClassName,
                 java.lang.Object params,
                 java.lang.Object delimitedIdentifier)
          throws StandardException
Initializer for a NewInvocationNode

Overrides:
init in class QueryTreeNode
Parameters:
javaClassName - The full package.class name of the class
Throws:
StandardException - Thrown on error

setSingleInstantiation

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

Returns:
Nothing.

getMethodParameterClasses

public java.lang.Class[] getMethodParameterClasses()
Get the resolved Classes of our parameters

Returns:
the Classes of our parameters

bindExpression

public JavaValueNode bindExpression(FromList fromList,
                                    SubqueryList subqueryList,
                                    java.util.Vector aggregateVector)
                             throws StandardException
Bind this expression. This means binding the sub-expressions, as well as figuring out what the return type is for this expression.

Specified by:
bindExpression in class JavaValueNode
Parameters:
fromList - The FROM list for the query this expression is in, for binding columns.
subqueryList - The subquery list being built as we find SubqueryNodes
aggregateVector - The aggregate vector being built as we find AggregateNodes
Returns:
Nothing
Throws:
StandardException - Thrown on error
See Also:
ValueNode.bindExpression(org.apache.derby.impl.sql.compile.FromList, org.apache.derby.impl.sql.compile.SubqueryList, java.util.Vector)

categorize

public boolean categorize(JBitSet referencedTabs,
                          boolean simplePredsOnly)
                   throws StandardException
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.

Overrides:
categorize in class MethodCallNode
Parameters:
referencedTabs - JBitSet with bit map of referenced FromTables
simplePredsOnly - Whether or not to consider method calls, field references and conditional nodes when building bit map
Returns:
boolean Whether or not source.expression is a ColumnReference or a VirtualColumnNode.
Throws:
StandardException - Thrown on error

getCorrelationTables

void getCorrelationTables(JBitSet correlationMap)
                    throws StandardException
Build a JBitSet of all of the tables that we are correlated with.

Parameters:
correlationMap - The JBitSet of the tables that we are correlated with.
Returns:
Nothing.
Throws:
StandardException

assignableTo

protected boolean assignableTo(java.lang.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 - The java class name we want to assign to
Returns:
boolean Whether or not this class is assignable to the specified class
Throws:
StandardException - Thrown on error

findPublicMethod

protected java.lang.reflect.Member findPublicMethod(java.lang.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 - The method name we are looking for
staticMethod - Whether or not the method we are looking for is static
Returns:
Member The Member representing the method (or null if the method doesn't exist).
Throws:
StandardException - Thrown on error

generateExpression

public void generateExpression(ExpressionClassBuilder acb,
                               MethodBuilder mb)
                        throws StandardException
Do code generation for this method call

Specified by:
generateExpression in class JavaValueNode
Parameters:
acb - The ExpressionClassBuilder for the class we're generating
mb - The method the expression will go into
Returns:
The compiled Expression
Throws:
StandardException - Thrown on error

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.