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

java.lang.Object
  extended by org.apache.derby.impl.sql.compile.QueryTreeNode
      extended by org.apache.derby.impl.sql.compile.StatementNode
          extended by org.apache.derby.impl.sql.compile.DDLStatementNode
              extended by org.apache.derby.impl.sql.compile.CreateAliasNode
All Implemented Interfaces:
Visitable

public class CreateAliasNode
extends DDLStatementNode

A CreateAliasNode represents a CREATE ALIAS statement.


Field Summary
private  AliasInfo aliasInfo
           
private  char aliasType
           
private  boolean delimitedIdentifier
           
static int DETERMINISTIC
           
static int DYNAMIC_RESULT_SET_COUNT
           
static int EXTERNAL_NAME
           
private  java.lang.String javaClassName
           
static int LANGUAGE
           
private  java.lang.String methodName
           
static int NULL_ON_NULL_INPUT
           
static int PARAMETER_ARRAY
           
static int PARAMETER_STYLE
           
static int RETURN_TYPE
           
static int ROUTINE_ELEMENT_COUNT
           
static int SQL_CONTROL
           
static int TABLE_NAME
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.DDLStatementNode
ADD_TYPE, DROP_TYPE, implicitCreateSchema, LOCKING_TYPE, MODIFY_TYPE, UNKNOWN_TYPE
 
Fields inherited from class org.apache.derby.impl.sql.compile.StatementNode
NEED_CURSOR_ACTIVATION, NEED_DDL_ACTIVATION, NEED_NOTHING_ACTIVATION, NEED_PARAM_ACTIVATION, NEED_ROW_ACTIVATION
 
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired
 
Constructor Summary
CreateAliasNode()
           
 
Method Summary
private  boolean anyStringTypeDescriptor()
          CreateAliasNode creates the RoutineAliasInfo for a user defined function or procedure in it's init method, which is called by the parser.
private  void bindParameterTypes(RoutineAliasInfo aliasInfo)
          Bind the class names for UDTs
 void bindStatement()
          Bind this CreateAliasNode.
 void init(java.lang.Object aliasName, java.lang.Object targetObject, java.lang.Object methodName, java.lang.Object aliasSpecificInfo, java.lang.Object aliasType, java.lang.Object delimitedIdentifier)
          Initializer for a CreateAliasNode
 ConstantAction makeConstantAction()
          Create the Constant information that will drive the guts of Execution.
 java.lang.String statementToString()
           
 
Methods inherited from class org.apache.derby.impl.sql.compile.DDLStatementNode
activationKind, bindName, generate, getFullName, getObjectName, getRelativeName, getSchemaDescriptor, getSchemaDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, init, initAndCheck, isAtomic, makeFromList, toString
 
Methods inherited from class org.apache.derby.impl.sql.compile.StatementNode
executeSchemaName, executeStatementName, generate, getSPSName, lockTableForCompilation, makeResultDescription, needsSavepoint, optimizeStatement
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, acceptChildren, bindOffsetFetch, bindRowMultiSet, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_ARRAY

public static final int PARAMETER_ARRAY
See Also:
Constant Field Values

TABLE_NAME

public static final int TABLE_NAME
See Also:
Constant Field Values

DYNAMIC_RESULT_SET_COUNT

public static final int DYNAMIC_RESULT_SET_COUNT
See Also:
Constant Field Values

LANGUAGE

public static final int LANGUAGE
See Also:
Constant Field Values

EXTERNAL_NAME

public static final int EXTERNAL_NAME
See Also:
Constant Field Values

PARAMETER_STYLE

public static final int PARAMETER_STYLE
See Also:
Constant Field Values

SQL_CONTROL

public static final int SQL_CONTROL
See Also:
Constant Field Values

DETERMINISTIC

public static final int DETERMINISTIC
See Also:
Constant Field Values

NULL_ON_NULL_INPUT

public static final int NULL_ON_NULL_INPUT
See Also:
Constant Field Values

RETURN_TYPE

public static final int RETURN_TYPE
See Also:
Constant Field Values

ROUTINE_ELEMENT_COUNT

public static final int ROUTINE_ELEMENT_COUNT
See Also:
Constant Field Values

javaClassName

private java.lang.String javaClassName

methodName

private java.lang.String methodName

aliasType

private char aliasType

delimitedIdentifier

private boolean delimitedIdentifier

aliasInfo

private AliasInfo aliasInfo
Constructor Detail

CreateAliasNode

public CreateAliasNode()
Method Detail

init

public void init(java.lang.Object aliasName,
                 java.lang.Object targetObject,
                 java.lang.Object methodName,
                 java.lang.Object aliasSpecificInfo,
                 java.lang.Object aliasType,
                 java.lang.Object delimitedIdentifier)
          throws StandardException
Initializer for a CreateAliasNode

Overrides:
init in class QueryTreeNode
Parameters:
aliasName - The name of the alias
targetObject - Target name
methodName - The method name
aliasType - The alias type
delimitedIdentifier - Whether or not to treat the class name as a delimited identifier if trying to resolve it as a class alias
Throws:
StandardException - Thrown on error

statementToString

public java.lang.String statementToString()
Specified by:
statementToString in class StatementNode

anyStringTypeDescriptor

private boolean anyStringTypeDescriptor()
CreateAliasNode creates the RoutineAliasInfo for a user defined function or procedure in it's init method, which is called by the parser. But at that time, we do not have the SchemaDescriptor ready to determine the collation type. Hence, at the bind time, when we do have the SchemaDescriptor available, we should go back and fix the RoutineAliasInfo to have correct collation for its character string parameters and also fix its return type (for functions) so as to have correct collation if it is returning character string type. This method here checks if the RoutineAliasInfo has any character string types associated with it. If not, then the RoutineAliasInfo that got created at parsing time is just fine. But if not, then we should take care of the collation type of it's character string types.

Returns:
true if it has a parameter or return type of character string

bindStatement

public void bindStatement()
                   throws StandardException
Bind this CreateAliasNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the column name list does not contain any duplicate column names.

Overrides:
bindStatement in class StatementNode
Throws:
StandardException - Thrown on error

bindParameterTypes

private void bindParameterTypes(RoutineAliasInfo aliasInfo)
                         throws StandardException
Bind the class names for UDTs

Throws:
StandardException

makeConstantAction

public ConstantAction makeConstantAction()
                                  throws StandardException
Create the Constant information that will drive the guts of Execution.

Overrides:
makeConstantAction in class QueryTreeNode
Throws:
StandardException - Thrown on failure

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.