Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql.compile
Class SpecialFunctionNode  view SpecialFunctionNode download SpecialFunctionNode.java

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.ValueNode
          extended byorg.apache.derby.impl.sql.compile.SpecialFunctionNode
All Implemented Interfaces:
org.apache.derby.iapi.sql.compile.Visitable

public class SpecialFunctionNode
extends ValueNode

SpecialFunctionNode handles system SQL functions. A function value is either obtained by a method call off the LanguageConnectionContext or Activation. LanguageConnectionContext functions are state related to the connection. Activation functions are those related to the statement execution. Each SQL function takes no arguments and returns a SQLvalue.

Functions supported:

This node is used rather than some use of MethodCallNode for runtime performance. MethodCallNode does not provide a fast access to the current language connection or activatation, since it is geared towards user defined routines.


Field Summary
private  java.lang.String methodName
          Java method name
private  java.lang.String methodType
          Return type of Java method.
(package private)  java.lang.String sqlName
          Name of SQL function
 
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
SpecialFunctionNode()
           
 
Method Summary
 ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector)
          Binding this special function means setting the result DataTypeServices.
 void generateExpression(ExpressionClassBuilder acb, org.apache.derby.iapi.services.compiler.MethodBuilder mb)
          Generate an expression that returns a DataValueDescriptor and calls a method off the language connection or the activation.
protected  int getOrderableVariantType()
          Return the variant type for the underlying expression.
 java.lang.String toString()
          Convert this object to a String.
 
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, categorize, changeToCNF, checkIsBoolean, checkReliability, checkReliability, checkTopPredicatesForEqualsConditions, constantExpression, copyFields, eliminateNots, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClause, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isConstantExpression, isParameterNode, isRelationalOperator, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, selectivity, setClause, setDescriptor, setTransformed, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, 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, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, printSubNodes, 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

sqlName

java.lang.String sqlName
Name of SQL function


methodName

private java.lang.String methodName
Java method name


methodType

private java.lang.String methodType
Return type of Java method.

Constructor Detail

SpecialFunctionNode

public SpecialFunctionNode()
Method Detail

bindExpression

public ValueNode bindExpression(FromList fromList,
                                SubqueryList subqueryList,
                                java.util.Vector aggregateVector)
                         throws org.apache.derby.iapi.error.StandardException
Binding this special function means setting the result DataTypeServices. In this case, the result type is based on the operation requested.

Overrides:
bindExpression in class ValueNode

getOrderableVariantType

protected int getOrderableVariantType()
Return the variant type for the underlying expression. All supported special functions are QUERY_INVARIANT

Overrides:
getOrderableVariantType in class ValueNode

generateExpression

public void generateExpression(ExpressionClassBuilder acb,
                               org.apache.derby.iapi.services.compiler.MethodBuilder mb)
                        throws org.apache.derby.iapi.error.StandardException
Generate an expression that returns a DataValueDescriptor and calls a method off the language connection or the activation.

Overrides:
generateExpression in class ValueNode

toString

public java.lang.String toString()
Description copied from class: ValueNode
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class ValueNode