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

pack-priv Class SetRoleNode

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 SetRoleNode is the root of a QueryTree that represents a SET ROLE statement.

Field Summary

Modifier and TypeField and Description
private String
private int

Constructor Summary

AccessConstructor and Description
pack-priv
SetRoleNode(String
The name of the new role, null if NONE specified
roleName
,
int
Type of role name could be USER or dynamic parameter
type
,
ContextManager
Context manager
cm
)

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.

Override: 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.

Override: Generate code, need to push parameters

private 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 boolean

Returns:

false
isAtomic
()

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

Override to allow committing of reading SYSROLES, cf. SetRoleConstantAction's call to userCommit to retain idle state.

public ConstantAction
makeConstantAction()

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

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

public 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

SetRoleNodeback to summary
pack-priv SetRoleNode(String roleName, int type, ContextManager cm) throws StandardException
Parameters
roleName:String

The name of the new role, null if NONE specified

type:int

Type of role name could be USER or dynamic parameter

cm:ContextManager

Context manager

Method Detail

activationKindback to summary
pack-priv int activationKind()

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

Override: 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.

Override: 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
private 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

Exceptions
StandardException:
Thrown on error
isAtomicback to summary
public boolean isAtomic()

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

Override to allow committing of reading SYSROLES, cf. SetRoleConstantAction's call to userCommit to retain idle state. If atomic, that commit will fail.

Returns:boolean

false

Annotations
@Override
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
public 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