Constraint constraint;
Expression.Collector collector;
Expression expression;
Function function;
Iterator iterator;
HashSet methodSet;
Method method;
Object[] row;
// column number mappings
final int icons_cat = 0;
final int icons_schem = 1;
final int icons_name = 2;
final int ir_cat = 3;
final int ir_schem = 4;
final int ir_name = 5;
tables = database.schemaManager.allTablesIterator();
collector = new Expression.Collector();
while (tables.hasNext()) {
collector.clear();
table = (Table) tables.next();
if (!isAccessibleTable(table)) {
continue;
}
constraints = table.getConstraints();
constraintCount = constraints.length;
constraintCatalog = ns.getCatalogName(table);
constraintSchema = table.getSchemaName();
for (int i = 0; i < constraintCount; i++) {
constraint = (Constraint) constraints[i];
if (constraint.getType() != Constraint.CHECK) {
continue;
}
constraintName = constraint.getName().name;
collector.addAll(constraint.core.check, Expression.FUNCTION);
methodSet = new HashSet();
iterator = collector.iterator();
while (iterator.hasNext()) {
expression = (Expression) iterator.next();
function = expression.function;
if (!session
.isAccessible(function.getMethod()
.getDeclaringClass().getName())) {
continue;
}
methodSet.add(function.getMethod());
}
iterator = methodSet.iterator();
while (iterator.hasNext()) {
method = (Method) iterator.next();
row = t.getEmptyRowData();
row[icons_cat] = constraintCatalog;