model.setUsageCount(selectedObjects);
}
private List<DatabaseObject> getTablesToInclude() {
List<DatabaseObject> objs = Lists.newArrayList();
DbTables tables = toEdit.getStructure().getDbTables();
for (DatabaseObject o : toEdit.getObjects()) {
if (o instanceof ManualSqlStatement) {
// Patch for bug 3048875.
// TODO: This is not ideal, because we will end up with an empty list of
// tables in the table selection page. It seems close to impossible to
// figure out what tables are used from the information in the mapping tree,
// but I haven't looked very closely at it.
continue;
}
String name = quotes.getSimpleName(o);
if (!name.equals(o.getName())) {
o = o.createCopy(name);
isSchemaNameIncluded = true;
}
String aliasCheck = isSchemaNameIncluded ? quotes.getQualifiedName(o) : name;
if (!tables.isAlias(aliasCheck)) {
objs.add(o);
}
}
return objs;
}