use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableForeignKeyColumn in project dbeaver by serge-rider.
the class MySQLForeignKeyConfigurator method configureObject.
@Override
public MySQLTableForeignKey configureObject(DBRProgressMonitor monitor, Object table, MySQLTableForeignKey foreignKey) {
return UITask.run(() -> {
EditForeignKeyPage editPage = new EditForeignKeyPage(MySQLUIMessages.edit_foreign_key_manager_title, foreignKey, new DBSForeignKeyModifyRule[] { DBSForeignKeyModifyRule.NO_ACTION, DBSForeignKeyModifyRule.CASCADE, DBSForeignKeyModifyRule.RESTRICT, DBSForeignKeyModifyRule.SET_NULL, DBSForeignKeyModifyRule.SET_DEFAULT });
if (!editPage.edit()) {
return null;
}
foreignKey.setReferencedKey((MySQLTableConstraint) editPage.getUniqueConstraint());
foreignKey.setDeleteRule(editPage.getOnDeleteRule());
foreignKey.setUpdateRule(editPage.getOnUpdateRule());
int colIndex = 1;
for (EditForeignKeyPage.FKColumnInfo tableColumn : editPage.getColumns()) {
foreignKey.addColumn(new MySQLTableForeignKeyColumn(foreignKey, (MySQLTableColumn) tableColumn.getOwnColumn(), colIndex++, (MySQLTableColumn) tableColumn.getRefColumn()));
}
return foreignKey;
});
}
use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableForeignKeyColumn in project dbeaver by dbeaver.
the class MySQLForeignKeyConfigurator method configureObject.
@Override
public MySQLTableForeignKey configureObject(DBRProgressMonitor monitor, Object table, MySQLTableForeignKey foreignKey) {
return UITask.run(() -> {
EditForeignKeyPage editPage = new EditForeignKeyPage(MySQLUIMessages.edit_foreign_key_manager_title, foreignKey, new DBSForeignKeyModifyRule[] { DBSForeignKeyModifyRule.NO_ACTION, DBSForeignKeyModifyRule.CASCADE, DBSForeignKeyModifyRule.RESTRICT, DBSForeignKeyModifyRule.SET_NULL, DBSForeignKeyModifyRule.SET_DEFAULT });
if (!editPage.edit()) {
return null;
}
foreignKey.setReferencedKey((MySQLTableConstraint) editPage.getUniqueConstraint());
foreignKey.setDeleteRule(editPage.getOnDeleteRule());
foreignKey.setUpdateRule(editPage.getOnUpdateRule());
int colIndex = 1;
for (EditForeignKeyPage.FKColumnInfo tableColumn : editPage.getColumns()) {
foreignKey.addColumn(new MySQLTableForeignKeyColumn(foreignKey, (MySQLTableColumn) tableColumn.getOwnColumn(), colIndex++, (MySQLTableColumn) tableColumn.getRefColumn()));
}
return foreignKey;
});
}
Aggregations