| java.lang.Object org.apache.derby.impl.sql.compile.QueryTreeNode org.apache.derby.impl.sql.compile.JavaValueNode org.apache.derby.impl.sql.compile.MethodCallNode org.apache.derby.impl.sql.compile.StaticMethodCallNode
StaticMethodCallNode | public class StaticMethodCallNode extends MethodCallNode (Code) | | A StaticMethodCallNode represents a static method call from a Class
(as opposed to from an Object).
For a procedure the call requires that the arguments be ? parameters.
The parameter is *logically* passed into the method call a number of different ways.
For a application call like CALL MYPROC(?) the logically Java method call is
(in psuedo Java/SQL code) (examples with CHAR(10) parameter)
Fixed length IN parameters - com.acme.MyProcedureMethod(?)
Variable length IN parameters - com.acme.MyProcedureMethod(CAST (? AS CHAR(10))
Fixed length INOUT parameter -
String[] holder = new String[] {?}; com.acme.MyProcedureMethod(holder); ? = holder[0]
Variable length INOUT parameter -
String[] holder = new String[] {CAST (? AS CHAR(10)}; com.acme.MyProcedureMethod(holder); ? = CAST (holder[0] AS CHAR(10))
Fixed length OUT parameter -
String[] holder = new String[1]; com.acme.MyProcedureMethod(holder); ? = holder[0]
Variable length INOUT parameter -
String[] holder = new String[1]; com.acme.MyProcedureMethod(holder); ? = CAST (holder[0] AS CHAR(10))
For static method calls there is no pre-definition of an IN or INOUT parameter, so a call to CallableStatement.registerOutParameter()
makes the parameter an INOUT parameter, provided:
- the parameter is passed directly to the method call (no casts or expressions).
- the method's parameter type is a Java array type.
Since this is a dynmaic decision we compile in code to take both paths, based upon a boolean isINOUT which is dervied from the
ParameterValueSet. Code is logically (only single parameter String[] shown here). Note, no casts can exist here.
boolean isINOUT = getParameterValueSet().getParameterMode(0) == PARAMETER_IN_OUT;
if (isINOUT) {
String[] holder = new String[] {?}; com.acme.MyProcedureMethod(holder); ? = holder[0]
} else {
com.acme.MyProcedureMethod(?)
}
author: Jerry Brenner |
bindExpression | public JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException(Code) | | Bind this expression. This means binding the sub-expressions,
as well as figuring out what the return type is for this expression.
Parameters: fromList - The FROM list for the query thisexpression is in, for binding columns. Parameters: subqueryList - The subquery list being built as we find SubqueryNodes Parameters: aggregateVector - The aggregate vector being built as we find AggregateNodes this or an AggregateNode exception: StandardException - Thrown on error |
categorize | public boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException(Code) | | 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 with bit map of referenced FromTables Parameters: simplePredsOnly - Whether or not to consider methodcalls, field references and conditional nodeswhen building bit map boolean Whether or not source.expression is a ColumnReferenceor a VirtualColumnNode. exception: StandardException - Thrown on error |
getPrivType | int getPrivType()(Code) | | Set default privilege of EXECUTE for this node.
|
init | public void init(Object methodName, Object javaClassName)(Code) | | Intializer for a NonStaticMethodCallNode
Parameters: methodName - The name of the method to call Parameters: javaClassName - The name of the java class that the static method belongs to. |
toString | public String toString()(Code) | | Convert this object to a String. See comments in QueryTreeNode.java
for how this should be done for tree printing.
This object as a String |
Methods inherited from org.apache.derby.impl.sql.compile.MethodCallNode | public Visitable accept(Visitor v) throws StandardException(Code)(Java Doc) public void addParms(JavaValueNode[] methodParms)(Code)(Java Doc) public void addParms(Vector parameterList) throws StandardException(Code)(Java Doc) protected boolean areParametersQueryInvariant() throws StandardException(Code)(Java Doc) final void bindParameters(FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException(Code)(Java Doc) public boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException(Code)(Java Doc) public void generateOneParameter(ExpressionClassBuilder acb, MethodBuilder mb, int parameterNumber) throws StandardException(Code)(Java Doc) public int generateParameters(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc) protected boolean[] getIsParam()(Code)(Java Doc) public String getJavaClassName()(Code)(Java Doc) public String getMethodName()(Code)(Java Doc) public JavaValueNode[] getMethodParms()(Code)(Java Doc) protected String[] getObjectSignature() throws StandardException(Code)(Java Doc) protected int getOrderableVariantType() throws StandardException(Code)(Java Doc) public static String getParameterTypeName(JavaValueNode param) throws StandardException(Code)(Java Doc) String[] getPrimitiveSignature(boolean castToPrimitiveAsNecessary) throws StandardException(Code)(Java Doc) public JSQLType[] getSignature()(Code)(Java Doc) public void init(Object methodName)(Code)(Java Doc) public void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException(Code)(Java Doc) public void printSubNodes(int depth)(Code)(Java Doc) public JavaValueNode remapColumnReferencesToExpressions() throws StandardException(Code)(Java Doc) protected void resolveMethodCall(String javaClassName, boolean staticMethod) throws StandardException(Code)(Java Doc) public void setClause(int clause)(Code)(Java Doc) public void setNullParameterInfo(String[] parmTypeNames) throws StandardException(Code)(Java Doc) protected boolean someParametersAreNull()(Code)(Java Doc) void throwNoMethodFound(String receiverTypeName, String[] parmTypeNames, String[] primParmTypeNames) throws StandardException(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
Methods inherited from org.apache.derby.impl.sql.compile.JavaValueNode | abstract JavaValueNode bindExpression(FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException(Code)(Java Doc) public void castToPrimitive(boolean booleanValue)(Code)(Java Doc) abstract public boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException(Code)(Java Doc) public void checkReliability(ValueNode sqlNode) throws StandardException(Code)(Java Doc) final protected void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc) abstract protected void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc) protected boolean generateReceiver(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc) final protected boolean generateReceiver(ExpressionClassBuilder acb, MethodBuilder mb, JavaValueNode receiver) throws StandardException(Code)(Java Doc) Object getConstantValueAsObject() throws StandardException(Code)(Java Doc) public JSQLType getJSQLType() throws StandardException(Code)(Java Doc) public String getJavaTypeName() throws StandardException(Code)(Java Doc) protected int getOrderableVariantType() throws StandardException(Code)(Java Doc) public String getPrimitiveTypeName() throws StandardException(Code)(Java Doc) final protected void getReceiverExpression(ExpressionClassBuilder acb, MethodBuilder mb, JavaValueNode receiver) throws StandardException(Code)(Java Doc) public boolean isPrimitiveType() throws StandardException(Code)(Java Doc) public TypeId mapToTypeID(JSQLType jsqlType)(Code)(Java Doc) public void markForCallStatement()(Code)(Java Doc) protected void markReturnValueDiscarded()(Code)(Java Doc) public boolean mustCastToPrimitive()(Code)(Java Doc) abstract public void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException(Code)(Java Doc) abstract public JavaValueNode remapColumnReferencesToExpressions() throws StandardException(Code)(Java Doc) protected boolean returnValueDiscarded()(Code)(Java Doc) protected void returnValueToSQLDomain()(Code)(Java Doc) public void setClause(int clause)(Code)(Java Doc) public void setJavaTypeName(String javaTypeName)(Code)(Java Doc) protected boolean valueReturnedToSQLDomain()(Code)(Java Doc)
|
Methods inherited from org.apache.derby.impl.sql.compile.QueryTreeNode | public Visitable accept(Visitor v) throws StandardException(Code)(Java Doc) public QueryTreeNode bind() throws StandardException(Code)(Java Doc) public DataValueDescriptor convertDefaultNode(DataTypeDescriptor typeDescriptor) throws StandardException(Code)(Java Doc) protected static void debugFlush()(Code)(Java Doc) public static void debugPrint(String outputString)(Code)(Java Doc) public void disablePrivilegeCollection()(Code)(Java Doc) public String executeSchemaName()(Code)(Java Doc) public String executeStatementName()(Code)(Java Doc) public static String formatNodeString(String nodeString, int depth)(Code)(Java Doc) public boolean foundString(String[] list, String search)(Code)(Java Doc) public GeneratedClass generate(ByteArray ignored) throws StandardException(Code)(Java Doc) protected void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc) void generateAuthorizeCheck(ActivationClassBuilder acb, MethodBuilder mb, int sqlOperation)(Code)(Java Doc) public int getBeginOffset()(Code)(Java Doc) final protected ClassFactory getClassFactory()(Code)(Java Doc) final protected CompilerContext getCompilerContext()(Code)(Java Doc) final public ContextManager getContextManager()(Code)(Java Doc) public Object getCursorInfo() throws StandardException(Code)(Java Doc) final public DataDictionary getDataDictionary()(Code)(Java Doc) final public DependencyManager getDependencyManager()(Code)(Java Doc) public int getEndOffset()(Code)(Java Doc) final public ExecutionFactory getExecutionFactory()(Code)(Java Doc) final public GenericConstantActionFactory getGenericConstantActionFactory()(Code)(Java Doc) protected int getIntProperty(String value, String key) throws StandardException(Code)(Java Doc) final protected LanguageConnectionContext getLanguageConnectionContext()(Code)(Java Doc) final public NodeFactory getNodeFactory()(Code)(Java Doc) protected int getNodeType()(Code)(Java Doc) public ConstantNode getNullNode(TypeId typeId, ContextManager cm) throws StandardException(Code)(Java Doc) public DataTypeDescriptor[] getParameterTypes() throws StandardException(Code)(Java Doc) public long getRowEstimate()(Code)(Java Doc) public String getSPSName()(Code)(Java Doc) final SchemaDescriptor getSchemaDescriptor(String schemaName) throws StandardException(Code)(Java Doc) final SchemaDescriptor getSchemaDescriptor(String schemaName, boolean raiseError) throws StandardException(Code)(Java Doc) protected int getStatementType()(Code)(Java Doc) final protected TableDescriptor getTableDescriptor(String tableName, SchemaDescriptor schema) throws StandardException(Code)(Java Doc) final protected TypeCompiler getTypeCompiler(TypeId typeId)(Code)(Java Doc) public void init(Object arg1) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14) throws StandardException(Code)(Java Doc) public boolean isAtomic() throws StandardException(Code)(Java Doc) protected boolean isInstanceOf(int nodeType)(Code)(Java Doc) public boolean isPrivilegeCollectionRequired()(Code)(Java Doc) final boolean isSessionSchema(SchemaDescriptor sd)(Code)(Java Doc) final boolean isSessionSchema(String schemaName)(Code)(Java Doc) public ConstantAction makeConstantAction() throws StandardException(Code)(Java Doc) public ResultDescription makeResultDescription() throws StandardException(Code)(Java Doc) public TableName makeTableName(String schemaName, String flatName) throws StandardException(Code)(Java Doc) public boolean needsSavepoint()(Code)(Java Doc) protected String nodeHeader()(Code)(Java Doc) public QueryTreeNode optimize() throws StandardException(Code)(Java Doc) public static QueryTreeNode parseQueryText(CompilerContext compilerContext, String queryText, Object[] paramDefaults, LanguageConnectionContext lcc) throws StandardException(Code)(Java Doc) public void printLabel(int depth, String label)(Code)(Java Doc) public void printSubNodes(int depth)(Code)(Java Doc) public boolean referencesSessionSchema() throws StandardException(Code)(Java Doc) public TableName resolveTableToSynonym(TableName tabName) throws StandardException(Code)(Java Doc) public void setBeginOffset(int beginOffset)(Code)(Java Doc) public void setContextManager(ContextManager cm)(Code)(Java Doc) public void setEndOffset(int endOffset)(Code)(Java Doc) public void setNodeType(int nodeType)(Code)(Java Doc) public void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, String parentResultSetId, boolean dependentScan)(Code)(Java Doc) public String toString()(Code)(Java Doc) public void treePrint()(Code)(Java Doc) public void treePrint(int depth)(Code)(Java Doc) String verifyClassExist(String javaClassName, boolean convertCase) throws StandardException(Code)(Java Doc)
|
|
|