error = false;
org.apache.ddlutils.model.ForeignKey foreignKeyddlutils = table.getForeignKeys()[i];
org.apache.ddlutils.model.Reference referenceddlutils = foreignKeyddlutils.getFirstReference();
Reference reference = new ReferenceDDLUtils (referenceddlutils);
Table foreignTable = TableUtils.getTable(database,foreignKeyddlutils.getForeignTableName());
Column foreignCol = new ColumnDDLUtils(referenceddlutils.getForeignColumn(),foreignTable);
foreignCol.setAlias(ReferenceUtils.getColumnAlias(foreignTable, foreignCol));
reference.setForeignColumn(foreignCol);
reference.setForeignColumnName(referenceddlutils.getForeignColumnName());
reference.setForeignTable(foreignTable);
reference.setForeignTableName(foreignKeyddlutils.getForeignTableName());
Column localCol = new ColumnDDLUtils(referenceddlutils.getLocalColumn(), this);
reference.setLocalColumn(localCol);
Table localTable = new TableDDLUtils(table);
reference.setLocalTable(localTable);
localCol.setAlias(ReferenceUtils.getColumnAlias(localTable, localCol));
if (reference.getForeignColumnName()==null) {
System.out.println ("error in ref : no column on "+table.getName()+" - "+reference.getLocalColumnName());
error = true;