// After the initial edges have been added to the graph, loop back
// through again looking for implicit references between two tables:
// + Tables implicitly joined by sharing parameters on foreign keys
// + Tables implicitly referenced together by using the same values on
// foreign keys
Statement catalog_stmts[] = this.catalog_proc.getStatements().values();
for (int stmt_ctr0 = 0, stmt_cnt = catalog_stmts.length; stmt_ctr0 < stmt_cnt; stmt_ctr0++) {
Statement catalog_stmt0 = catalog_stmts[stmt_ctr0];
Collection<Table> stmt0_tables = CatalogUtil.getReferencedTables(catalog_stmt0);
this.setDebug(stmt0_tables.containsAll(debug_tables));
// --------------------------------------------------------------
// (3) Add an edge between the tables in this Statement and all other
// tables in other queries that share input parameters on foreign
// keys relationships
// --------------------------------------------------------------
List<ProcParameter> params0 = new ArrayList<ProcParameter>();
for (StmtParameter param : catalog_stmt0.getParameters()) {
if (param.getProcparameter() != null)
params0.add(param.getProcparameter());
} // FOR
if (debug && d)
LOG.debug(catalog_stmt0.getName() + " Params: " + params0);
for (int stmt_ctr1 = stmt_ctr0 + 1; stmt_ctr1 < stmt_cnt; stmt_ctr1++) {
Statement catalog_stmt1 = catalog_stmts[stmt_ctr1];
if (catalog_stmt1 == null || catalog_stmt1.getParameters() == null)
continue;
this.createSharedParamEdges(agraph, catalog_stmt0, catalog_stmt1, params0);
} // FOR
// --------------------------------------------------------------