if (referrers == null || !referrers.contains(fk))
{
foreignTable.addReferrer(fk);
}
Column local = currTable
.getColumn(attributes.getValue("local"));
// give notice of a schema inconsistency.
// note we do not prevent the npe as there is nothing
// that we can do, if it is to occur.
if ( local == null )
{
System.out.println("ERROR!! Attempt to define foreign"
+ " key with nonexistent column, " +
attributes.getValue("local") + ", in table, " +
currTable.getName() + "!" );
}
//check for foreign pk's
if (local.isPrimaryKey())
{
currTable.setContainsForeignPK(true);
}
Column foreign = foreignTable
.getColumn(attributes.getValue("foreign"));
// if the foreign column does not exist, we may have an
// external reference or a misspelling
if ( foreign == null )
{
System.out.println("ERROR!! Attempt to set foreign"
+ " key to nonexistent column, " +
attributes.getValue("foreign") + ", in table, "
+ foreignTable.getName() + "!" );
}
foreign.addReferrer(fk);
}
}
else
{
if (rawName.equals("database"))