table.setForeignKey (foreignKey);
}
public static ForeignKey getForeignKey (Field field, Database database) {
if (field.getLinkToTargetEntity()!=null && field.getLinkToTargetField()!=null) {
Reference reference = ReferenceUtils.getReference(field, database);
if (reference!=null) {
org.apache.ddlutils.model.ForeignKey foreignKeyMp = new org.apache.ddlutils.model.ForeignKey();
foreignKeyMp.setName(field.getName());
ForeignKey foreignKey = new ForeignKeyDDLUtils (foreignKeyMp);
foreignKey.setForeignTableName(field.getLinkToTargetEntity());