Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class SetSchemaNode

extends MiscellaneousStatementNode
Class Inheritance
Imports
java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.ClassName, org.apache.derby.iapi.services.classfile.VMOpcode, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.StatementType, org.apache.derby.iapi.sql.execute.ConstantAction

A SetSchemaNode is the root of a QueryTree that represents a SET SCHEMA statement. It isn't replicated, but it generates a ConstantAction because it is basically easier than generating the code from scratch.

Field Summary

Modifier and TypeField and Description
private String
private int

Constructor Summary

AccessConstructor and Description
pack-priv
SetSchemaNode(String
The name of the new schema
schemaName
,
int
Type of schema name could be USER or dynamic parameter
type
,
ContextManager
The context manager
cm
)

Constructor for a SetSchemaNode

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

NEED_PARAM_ACTIVATION or NEED_NOTHING_ACTIVATION depending on params
activationKind
()

Overrides org.apache.derby.impl.sql.compile.MiscellaneousStatementNode.activationKind.

Returns the type of activation this class generates.

pack-priv void
generate(ActivationClassBuilder
The ActivationClassBuilder for the class being built
acb
,
MethodBuilder
the method for the execute() method to be built
mb
)

Overrides org.apache.derby.impl.sql.compile.MiscellaneousStatementNode.generate.

Generate code, need to push parameters

pack-priv void
generateParameterValueSet(ActivationClassBuilder
The ActivationClassBuilder for the class we're building
acb
)

Generate the code to create the ParameterValueSet, if necessary, when constructing the activation.

public ConstantAction
makeConstantAction()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.makeConstantAction.

Create the Constant information that will drive the guts of Execution.

pack-priv String
public String

Returns:

This object as a String
toString
()

Overrides org.apache.derby.impl.sql.compile.StatementNode.toString.

Convert this object to a String.

Inherited from org.apache.derby.impl.sql.compile.MiscellaneousStatementNode:
needsSavepoint

Field Detail

nameback to summary
private String name
typeback to summary
private int type

Constructor Detail

SetSchemaNodeback to summary
pack-priv SetSchemaNode(String schemaName, int type, ContextManager cm)

Constructor for a SetSchemaNode

Parameters
schemaName:String

The name of the new schema

type:int

Type of schema name could be USER or dynamic parameter

cm:ContextManager

The context manager

Method Detail

activationKindback to summary
pack-priv int activationKind()

Overrides org.apache.derby.impl.sql.compile.MiscellaneousStatementNode.activationKind.

Returns the type of activation this class generates.

Returns:int

NEED_PARAM_ACTIVATION or NEED_NOTHING_ACTIVATION depending on params

Annotations
@Override
generateback to summary
pack-priv void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException

Overrides org.apache.derby.impl.sql.compile.MiscellaneousStatementNode.generate.

Generate code, need to push parameters

Parameters
acb:ActivationClassBuilder

The ActivationClassBuilder for the class being built

mb:MethodBuilder

the method for the execute() method to be built

Annotations
@Override
Exceptions
StandardException:
Thrown on error
generateParameterValueSetback to summary
pack-priv void generateParameterValueSet(ActivationClassBuilder acb) throws StandardException

Generate the code to create the ParameterValueSet, if necessary, when constructing the activation. Also generate the code to call a method that will throw an exception if we try to execute without all the parameters being set.

Parameters
acb:ActivationClassBuilder

The ActivationClassBuilder for the class we're building

makeConstantActionback to summary
public ConstantAction makeConstantAction() throws StandardException

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.makeConstantAction.

Create the Constant information that will drive the guts of Execution.

Annotations
@Override
Exceptions
StandardException:
Thrown on failure
statementToStringback to summary
pack-priv String statementToString()

Implements abstract org.apache.derby.impl.sql.compile.StatementNode.statementToString.

toStringback to summary
public String toString()

Overrides org.apache.derby.impl.sql.compile.StatementNode.toString.

Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Returns:String

This object as a String

Annotations
@Override