addReferences(object);
}
public void removeSchemaObject(HsqlName name, boolean cascade) {
OrderedHashSet objectSet = new OrderedHashSet();
switch (name.type) {
case SchemaObject.ROUTINE :
case SchemaObject.PROCEDURE :
case SchemaObject.FUNCTION : {
RoutineSchema routine = (RoutineSchema) getSchemaObject(name);
if (routine != null) {
Routine[] specifics = routine.getSpecificRoutines();
for (int i = 0; i < specifics.length; i++) {
getCascadingReferencingObjectNames(
specifics[i].getSpecificName(), objectSet);
}
}
}
break;
case SchemaObject.SEQUENCE :
case SchemaObject.TABLE :
case SchemaObject.VIEW :
case SchemaObject.TYPE :
case SchemaObject.CHARSET :
case SchemaObject.COLLATION :
case SchemaObject.SPECIFIC_ROUTINE :
getCascadingReferencingObjectNames(name, objectSet);
break;
case SchemaObject.DOMAIN :
OrderedHashSet set = getReferencingObjectNames(name);
Iterator it = set.iterator();
while (it.hasNext()) {
HsqlName ref = (HsqlName) it.next();
if (ref.type == SchemaObject.COLUMN) {
it.remove();
}
}
if (!set.isEmpty()) {
HsqlName objectName = (HsqlName) set.get(0);
throw Error.error(
ErrorCode.X_42502,
objectName.getSchemaQualifiedStatementName());
}