List depsOnAlterTableList = dd.getProvidersDescriptorList(td.getObjectID().toString());
for (Iterator depsOnAlterTableIterator = depsOnAlterTableList.listIterator();
depsOnAlterTableIterator.hasNext();)
{
//Go through all the dependent objects on the table being altered
DependencyDescriptor depOnAlterTableDesc =
(DependencyDescriptor) depsOnAlterTableIterator.next();
DependableFinder dependent = depOnAlterTableDesc.getDependentFinder();
//For the given dependent, we are only interested in it if it is a
// stored prepared statement.
if (dependent.getSQLObjectType().equals(Dependable.STORED_PREPARED_STATEMENT))
{
//Look for all the dependent objects that are using this
// stored prepared statement as provider. We are only
// interested in dependents that are triggers.
List depsTrigger = dd.getProvidersDescriptorList(depOnAlterTableDesc.getUUID().toString());
for (Iterator depsTriggerIterator = depsTrigger.listIterator();
depsTriggerIterator.hasNext();)
{
DependencyDescriptor depsTriggerDesc =
(DependencyDescriptor) depsTriggerIterator.next();
DependableFinder providerIsTrigger = depsTriggerDesc.getDependentFinder();
//For the given dependent, we are only interested in it if
// it is a trigger
if (providerIsTrigger.getSQLObjectType().equals(Dependable.TRIGGER)) {
//Drop and recreate the trigger after regenerating
// it's trigger action plan. If the trigger action
// depends on the column being dropped, it will be
// caught here.
TriggerDescriptor trdToBeDropped = dd.getTriggerDescriptor(depsTriggerDesc.getUUID());
columnDroppedAndTriggerDependencies(trdToBeDropped,
cascade, columnName);
}
}
}