TableColumn pkColumn = (pkTable == null) ? null : pkTable.findColumnByName(pkColumnName);
// Sets mapped source column (in PK/source table) for this foreign key column
fkColumn.setSourceColumn(pkColumn);
// add FK column to the foreign key
fk.addColumn(fkColumn);
}
}
// add FK to the table
table.addForeignKey(fk);