| java.lang.Object org.apache.derby.impl.sql.execute.GenericConstantAction org.apache.derby.impl.sql.execute.DDLConstantAction
All known Subclasses: org.apache.derby.impl.sql.execute.SavepointConstantAction, org.apache.derby.impl.sql.execute.ReplaceJarConstantAction, org.apache.derby.impl.sql.execute.CreateTableConstantAction, org.apache.derby.impl.sql.execute.DropViewConstantAction, org.apache.derby.impl.sql.execute.SetConstraintsConstantAction, org.apache.derby.impl.sql.execute.CreateViewConstantAction, org.apache.derby.impl.sql.execute.DropJarConstantAction, org.apache.derby.impl.sql.execute.DropStatisticsConstantAction, org.apache.derby.impl.sql.execute.CreateAliasConstantAction, org.apache.derby.impl.sql.execute.DropSchemaConstantAction, org.apache.derby.impl.sql.execute.AddJarConstantAction, org.apache.derby.impl.sql.execute.CreateSchemaConstantAction, org.apache.derby.impl.sql.execute.UpdateStatisticsConstantAction, org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction, org.apache.derby.impl.sql.execute.DropAliasConstantAction,
DDLConstantAction | abstract public class DDLConstantAction extends GenericConstantAction (Code) | | Abstract class that has actions that are across
all DDL actions.
author: jamie |
Method Summary | |
protected String | constructToString(String statementType, String objectName) | static SchemaDescriptor | getAndCheckSchemaDescriptor(DataDictionary dd, UUID schemaId, String statementType) Get the schema descriptor for the schemaid.
Parameters: dd - the data dictionary Parameters: schemaId - the schema id Parameters: statementType - string describing type of statement for errorreporting. | static SchemaDescriptor | getSchemaDescriptorForCreate(DataDictionary dd, Activation activation, String schemaName) Get the schema descriptor in the creation of an object in
the passed in schema. | final void | lockTableForDDL(TransactionController tc, long heapConglomerateNumber, boolean exclusiveMode) Lock the table in exclusive or share mode to prevent deadlocks. | protected void | storeConstraintDependenciesOnPrivileges(Activation activation, Dependent dependent, UUID refTableUUID) This method saves dependencies of constraints on privileges in the
dependency system. | protected void | storeViewTriggerDependenciesOnPrivileges(Activation activation, Dependent dependent) This method saves dependencies of views and triggers on privileges in
the dependency system. |
getAndCheckSchemaDescriptor | static SchemaDescriptor getAndCheckSchemaDescriptor(DataDictionary dd, UUID schemaId, String statementType) throws StandardException(Code) | | Get the schema descriptor for the schemaid.
Parameters: dd - the data dictionary Parameters: schemaId - the schema id Parameters: statementType - string describing type of statement for errorreporting. e.g. "ALTER STATEMENT" the schema descriptor exception: StandardException - if schema is system schema |
getSchemaDescriptorForCreate | static SchemaDescriptor getSchemaDescriptorForCreate(DataDictionary dd, Activation activation, String schemaName) throws StandardException(Code) | | Get the schema descriptor in the creation of an object in
the passed in schema.
Parameters: dd - the data dictionary Parameters: activation - activation Parameters: schemaName - name of the schema the schema descriptor exception: StandardException - if the schema does not exist |
lockTableForDDL | final void lockTableForDDL(TransactionController tc, long heapConglomerateNumber, boolean exclusiveMode) throws StandardException(Code) | | Lock the table in exclusive or share mode to prevent deadlocks.
Parameters: tc - The TransactionController Parameters: heapConglomerateNumber - The conglomerate number for the heap. Parameters: exclusiveMode - Whether or not to lock the table in exclusive mode. exception: StandardException - if schema is system schema |
storeConstraintDependenciesOnPrivileges | protected void storeConstraintDependenciesOnPrivileges(Activation activation, Dependent dependent, UUID refTableUUID) throws StandardException(Code) | | This method saves dependencies of constraints on privileges in the
dependency system. It gets called by CreateConstraintConstantAction.
Views and triggers and constraints run with definer's privileges. If
one of the required privileges is revoked from the definer, the
dependent view/trigger/constraint on that privilege will be dropped
automatically. In order to implement this behavior, we need to save
view/trigger/constraint dependencies on required privileges in the
dependency system. Following method accomplishes that part of the
equation for constraints only. The dependency collection for
constraints is not same as for views and triggers and hence
constraints are handled by this special method.
Views and triggers can depend on many different kind of privileges
where as constraints only depend on REFERENCES privilege on a table.
Another difference is only one view or trigger can be defined by a
sql statement and hence all the dependencies collected for the sql
statement apply to the view or trigger in question. As for constraints,
one sql statement can defined multiple constraints and hence the
all the privileges required by the statement are not necessarily
required by all the constraints defined by that sql statement. We need
to identify right privileges for right constraints for a given sql
statement. Because of these differences between constraints and views
(and triggers), there are 2 different methods in this class to save
their privileges in the dependency system.
Parameters: activation - The execution environment for this constant action. Parameters: dependent - Make this object depend on required privileges Parameters: refTableUUID - Make sure we are looking for REFERENCES privilege for right table exception: StandardException - Thrown on failure |
storeViewTriggerDependenciesOnPrivileges | protected void storeViewTriggerDependenciesOnPrivileges(Activation activation, Dependent dependent) throws StandardException(Code) | | This method saves dependencies of views and triggers on privileges in
the dependency system. It gets called by CreateViewConstantAction
and CreateTriggerConstantAction. Views and triggers and constraints
run with definer's privileges. If one of the required privileges is
revoked from the definer, the dependent view/trigger/constraint on
that privilege will be dropped automatically. In order to implement
this behavior, we need to save view/trigger/constraint dependencies
on required privileges in the dependency system. Following method
accomplishes that part of the equation for views and triggers. The
dependency collection for constraints is not same as for views and
triggers and hence constraints are not covered by this method.
Views and triggers can depend on many different kind of privileges
where as constraints only depend on REFERENCES privilege on a table.
Another difference is only one view or trigger can be defined by a
sql statement and hence all the dependencies collected for the sql
statement apply to the view or trigger in question. As for constraints,
one sql statement can defined multiple constraints and hence the
all the privileges required by the statement are not necessarily
required by all the constraints defined by that sql statement. We need
to identify right privileges for right constraints for a given sql
statement. Because of these differences between constraints and views
(and triggers), there are 2 different methods in this class to save
their privileges in the dependency system.
Parameters: activation - The execution environment for this constant action. Parameters: dependent - Make this object depend on required privileges exception: StandardException - Thrown on failure |
|
|