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

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.DefaultNode
All Implemented Interfaces:
Visitable

public class DefaultNode
extends ValueNode

DefaultNode represents a column/parameter default.


Field Summary
private  java.lang.String columnName
           
private  java.lang.String defaultText
           
private  ValueNode defaultTree
           
 
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
DefaultNode()
           
 
Method Summary
 ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector)
          Bind this expression.
 void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
          Generate code for this calculation.
 java.lang.String getDefaultText()
          Get the text of the default.
(package private)  ValueNode getDefaultTree()
          Get the query tree for the default.
 void init(java.lang.Object columnName)
          Initializer for insert/update
 void init(java.lang.Object defaultTree, java.lang.Object defaultText)
          Initializer for a column/parameter default.
static ValueNode parseDefault(java.lang.String defaultText, LanguageConnectionContext lcc, CompilerContext cc)
          Parse a default and turn it into a query tree.
 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, getOrderableVariantType, 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, 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

columnName

private java.lang.String columnName

defaultText

private java.lang.String defaultText

defaultTree

private ValueNode defaultTree
Constructor Detail

DefaultNode

public DefaultNode()
Method Detail

init

public void init(java.lang.Object defaultTree,
                 java.lang.Object defaultText)
Initializer for a column/parameter default.

Overrides:
init in class QueryTreeNode
Parameters:
defaultTree - Query tree for default
defaultText - The text of the default.

init

public void init(java.lang.Object columnName)
Initializer for insert/update

Overrides:
init in class QueryTreeNode

getDefaultText

public java.lang.String getDefaultText()
Get the text of the default.


getDefaultTree

ValueNode getDefaultTree()
Get the query tree for the default.

Returns:
The query tree for the default.

toString

public java.lang.String toString()
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
Returns:
This object as a String

bindExpression

public ValueNode 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. In this case, there are no sub-expressions, and the return type is already known, so this is just a stub.

Overrides:
bindExpression in class ValueNode
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:
The new top of the expression tree.
Throws:
StandardException - Thrown on failure

parseDefault

public static ValueNode parseDefault(java.lang.String defaultText,
                                     LanguageConnectionContext lcc,
                                     CompilerContext cc)
                              throws StandardException
Parse a default and turn it into a query tree.

Parameters:
defaultText - Text of Default.
lcc - LanguageConnectionContext
cc - CompilerContext
Returns:
The parsed default as a query tree.
Throws:
StandardException - Thrown on failure

generateExpression

public void generateExpression(ExpressionClassBuilder acb,
                               MethodBuilder mb)
                        throws StandardException
Description copied from class: ValueNode
Generate code for this calculation. This is a place-holder method - it should not be called.

Overrides:
generateExpression in class ValueNode
Parameters:
mb - The method the expression will go into
Throws:
StandardException - Thrown on failure

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.