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

pack-priv abstract Class DDLSingleTableConstantAction

extends DDLConstantAction
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.sql.execute.DropTableConstantAction, org.apache.derby.impl.sql.execute.DropTriggerConstantAction, org.apache.derby.impl.sql.execute.IndexConstantAction, org.apache.derby.impl.sql.execute.RenameConstantAction, org.apache.derby.impl.sql.execute.AlterTableConstantAction, org.apache.derby.impl.sql.execute.ConstraintConstantAction, org.apache.derby.impl.sql.execute.CreateTriggerConstantAction
Imports
java.util.ArrayList, .List, .Properties, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, .ConstraintDescriptor, .KeyConstraintDescriptor, .DataDictionary, .TableDescriptor, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.store.access.ConglomerateController, .TransactionController

Abstract class that has actions that are across all DDL actions that are tied to a table. An example of DDL that affects a table is CREATE INDEX or DROP VIEW. An example of DDL that does not affect a table is CREATE STATEMENT or DROP SCHEMA.

Field Summary

Modifier and TypeField and Description
protected UUID

Constructor Summary

AccessConstructor and Description
pack-priv
DDLSingleTableConstantAction(UUID
the target table
tableId
)

constructor

Method Summary

Modifier and TypeMethod and Description
pack-priv void
dropConglomerate(ConglomerateDescriptor
ConglomerateDescriptor for the conglom to drop
congDesc
,
TableDescriptor
TableDescriptor for the table on which congDesc exists
td
,
Activation
Activation used when creating a new backing index (if a new backing index is needed)
activation
,
LanguageConnectionContext
LanguageConnectionContext used for dropping
lcc
)

Similar to dropConstraint(...) above, except this method drops a conglomerate directly instead of going through a ConstraintDescriptor.

pack-priv void
dropConglomerate(ConglomerateDescriptor congDesc, TableDescriptor td, boolean
If true then we will skip the "create new conglomerate" processing for the dropped conglom.
skipCreate
,
List<ConstantAction>
Optional List. If non-null then for each ConglomerateDescriptor for which we skip the "create new conglomerate" processing we will add a ConstantAction to this list. The constant action can then be executed later (esp. by the caller) to create the new conglomerate, if needed. If this argument is null and we skip creation of a new conglomerate, the new conglomerate is effectively ignored (which may be fine in some cases-- ex. when dropping a table).
newConglomActions
,
Activation activation, LanguageConnectionContext lcc)

See "dropConglomerate(...)" above.

pack-priv void
dropConstraint(ConstraintDescriptor
ConstraintDescriptor for the constraint to drop
consDesc
,
Activation
Activation used when creating a new backing index (if a new backing index is needed)
activation
,
LanguageConnectionContext
LanguageConnectionContext used for dropping
lcc
,
boolean
Whether or not to clear dependencies when dropping the constraint
clearDeps
)

Drop the constraint corresponding to the received descriptor.

pack-priv void
dropConstraint(ConstraintDescriptor consDesc, TableDescriptor
Optional TableDescriptor. If non-null then we will skip the "create new conglomerate" processing *IF* the constraint that we drop came from the table described by skipCreate.
skipCreate
,
Activation activation, LanguageConnectionContext lcc, boolean clearDeps)

See "dropConstraint(...") above.

pack-priv void
dropConstraint(ConstraintDescriptor consDesc, TableDescriptor skipCreate, List<ConstantAction>
Optional List. If non-null then for each ConglomerateDescriptor for which we skip the "create new conglomerate" processing we will add a ConstantAction to this list. The constant action can then be executed later (esp. by the caller) to create the new conglomerate, if needed. If this argument is null and we skip creation of a new conglomerate, the new conglomerate is effectively ignored (which may be fine in some cases-- ex. when dropping a table).
newConglomActions
,
Activation activation, LanguageConnectionContext lcc, boolean clearDeps)

See "dropConstraint(...") above.

pack-priv void
executeConglomReplacement(ConstantAction
Constant action which, when executed, will either create a new conglomerate or find an existing one that satisfies the ConstantAction's requirements.
replaceConglom
,
Activation
Activation used when creating the conglom
activation
)

Execute the received ConstantAction, which will create a new physical conglomerate (or find an existing physical conglomerate that is "sharable") to replace some dropped physical conglomerate.

pack-priv ConstantAction
getConglomReplacementAction(ConglomerateDescriptor
Descriptor describing what the replacement physical conglomerate should look like
srcCD
,
TableDescriptor
Table descriptor for the table to which srcCD belongs
td
,
Properties
Properties from the old (dropped) conglom that should be "forwarded" to the new (replacement) conglom.
properties
)

Create a ConstantAction which, when executed, will create a new conglomerate whose attributes match those of the received ConglomerateDescriptor.

private void
loadIndexProperties(LanguageConnectionContext lcc, ConglomerateDescriptor congDesc, Properties ixProps)

Get any table properties that exist for the received index descriptor.

pack-priv void
recreateUniqueConstraintBackingIndexAsUniqueWhenNotNull(ConglomerateDescriptor
ConglomerateDescritor to recreate
cd
,
TableDescriptor
TableDescriptor for table on which congDesc exists
td
,
Activation
Activation used when creating a new backing index (if a new backing index is needed)
activation
,
LanguageConnectionContext
LanguageConnectionContext used for dropping
lcc
)

Recreate backing index of unique constraint.

Inherited from org.apache.derby.impl.sql.execute.DDLConstantAction:
addColumnDependenciesadjustUDTDependenciesadjustUDTDependenciesconstructToStringgetAndCheckSchemaDescriptorgetSchemaDescriptorForCreatelockTableForDDLstoreConstraintDependenciesOnPrivilegesstoreViewTriggerDependenciesOnPrivileges

Field Detail

tableIdback to summary
protected UUID tableId

Constructor Detail

DDLSingleTableConstantActionback to summary
pack-priv DDLSingleTableConstantAction(UUID tableId)

constructor

Parameters
tableId:UUID

the target table

Method Detail

dropConglomerateback to summary
pack-priv void dropConglomerate(ConglomerateDescriptor congDesc, TableDescriptor td, Activation activation, LanguageConnectionContext lcc) throws StandardException

Similar to dropConstraint(...) above, except this method drops a conglomerate directly instead of going through a ConstraintDescriptor.

Parameters
congDesc:ConglomerateDescriptor

ConglomerateDescriptor for the conglom to drop

td:TableDescriptor

TableDescriptor for the table on which congDesc exists

activation:Activation

Activation used when creating a new backing index (if a new backing index is needed)

lcc:LanguageConnectionContext

LanguageConnectionContext used for dropping

dropConglomerateback to summary
pack-priv void dropConglomerate(ConglomerateDescriptor congDesc, TableDescriptor td, boolean skipCreate, List<ConstantAction> newConglomActions, Activation activation, LanguageConnectionContext lcc) throws StandardException

See "dropConglomerate(...)" above.

Parameters
skipCreate:boolean

If true then we will skip the "create new conglomerate" processing for the dropped conglom.

newConglomActions:List<ConstantAction>

Optional List. If non-null then for each ConglomerateDescriptor for which we skip the "create new conglomerate" processing we will add a ConstantAction to this list. The constant action can then be executed later (esp. by the caller) to create the new conglomerate, if needed. If this argument is null and we skip creation of a new conglomerate, the new conglomerate is effectively ignored (which may be fine in some cases-- ex. when dropping a table).

dropConstraintback to summary
pack-priv void dropConstraint(ConstraintDescriptor consDesc, Activation activation, LanguageConnectionContext lcc, boolean clearDeps) throws StandardException

Drop the constraint corresponding to the received descriptor. If in doing so we also drop a backing conglomerate that is shared by other constraints/indexes, then we have to create a new conglomerate to fill the gap. This method exists here as a "utility" method for the various constant actions that may drop constraints in one way or another (there are several that do).

Parameters
consDesc:ConstraintDescriptor

ConstraintDescriptor for the constraint to drop

activation:Activation

Activation used when creating a new backing index (if a new backing index is needed)

lcc:LanguageConnectionContext

LanguageConnectionContext used for dropping

clearDeps:boolean

Whether or not to clear dependencies when dropping the constraint

dropConstraintback to summary
pack-priv void dropConstraint(ConstraintDescriptor consDesc, TableDescriptor skipCreate, Activation activation, LanguageConnectionContext lcc, boolean clearDeps) throws StandardException

See "dropConstraint(...") above.

Parameters
skipCreate:TableDescriptor

Optional TableDescriptor. If non-null then we will skip the "create new conglomerate" processing *IF* the constraint that we drop came from the table described by skipCreate.

dropConstraintback to summary
pack-priv void dropConstraint(ConstraintDescriptor consDesc, TableDescriptor skipCreate, List<ConstantAction> newConglomActions, Activation activation, LanguageConnectionContext lcc, boolean clearDeps) throws StandardException

See "dropConstraint(...") above.

Parameters
newConglomActions:List<ConstantAction>

Optional List. If non-null then for each ConglomerateDescriptor for which we skip the "create new conglomerate" processing we will add a ConstantAction to this list. The constant action can then be executed later (esp. by the caller) to create the new conglomerate, if needed. If this argument is null and we skip creation of a new conglomerate, the new conglomerate is effectively ignored (which may be fine in some cases-- ex. when dropping a table).

executeConglomReplacementback to summary
pack-priv void executeConglomReplacement(ConstantAction replaceConglom, Activation activation) throws StandardException

Execute the received ConstantAction, which will create a new physical conglomerate (or find an existing physical conglomerate that is "sharable") to replace some dropped physical conglomerate. Then find any conglomerate descriptors which still reference the dropped physical conglomerate and update them all to have a conglomerate number that points to the conglomerate created by the ConstantAction. This method is called as part of DROP processing to handle cases where a physical conglomerate that was shared by multiple descriptors is dropped--in which case a new physical conglomerate must be created to support the remaining descriptors.

Parameters
replaceConglom:ConstantAction

Constant action which, when executed, will either create a new conglomerate or find an existing one that satisfies the ConstantAction's requirements.

activation:Activation

Activation used when creating the conglom

getConglomReplacementActionback to summary
pack-priv ConstantAction getConglomReplacementAction(ConglomerateDescriptor srcCD, TableDescriptor td, Properties properties) throws StandardException

Create a ConstantAction which, when executed, will create a new conglomerate whose attributes match those of the received ConglomerateDescriptor.

Parameters
srcCD:ConglomerateDescriptor

Descriptor describing what the replacement physical conglomerate should look like

td:TableDescriptor

Table descriptor for the table to which srcCD belongs

properties:Properties

Properties from the old (dropped) conglom that should be "forwarded" to the new (replacement) conglom.

loadIndexPropertiesback to summary
private void loadIndexProperties(LanguageConnectionContext lcc, ConglomerateDescriptor congDesc, Properties ixProps) throws StandardException

Get any table properties that exist for the received index descriptor.

recreateUniqueConstraintBackingIndexAsUniqueWhenNotNullback to summary
pack-priv void recreateUniqueConstraintBackingIndexAsUniqueWhenNotNull(ConglomerateDescriptor cd, TableDescriptor td, Activation activation, LanguageConnectionContext lcc) throws StandardException

Recreate backing index of unique constraint. It first drops the existing index and creates it again with uniqueness set to false and uniqueWhenNotNull set to true. It reuses the uuid so there is no need to update ConstraintDescriptor.

Parameters
cd:ConglomerateDescriptor

ConglomerateDescritor to recreate

td:TableDescriptor

TableDescriptor for table on which congDesc exists

activation:Activation

Activation used when creating a new backing index (if a new backing index is needed)

lcc:LanguageConnectionContext

LanguageConnectionContext used for dropping