use of org.jkiss.dbeaver.ext.mssql.model.SQLServerTableUniqueKeyColumn in project dbeaver by serge-rider.
the class SQLServerUniqueKeyConfigurator method configureObject.
@Override
public SQLServerTableUniqueKey configureObject(DBRProgressMonitor monitor, Object container, SQLServerTableUniqueKey primaryKey) {
return UITask.run(() -> {
EditConstraintPage editPage = new EditConstraintPage("Create constraint", primaryKey, new DBSEntityConstraintType[] { DBSEntityConstraintType.PRIMARY_KEY, DBSEntityConstraintType.UNIQUE_KEY });
if (!editPage.edit()) {
return null;
}
primaryKey.setConstraintType(editPage.getConstraintType());
primaryKey.setName(editPage.getConstraintName());
int colIndex = 1;
for (DBSEntityAttribute tableColumn : editPage.getSelectedAttributes()) {
primaryKey.addColumn(new SQLServerTableUniqueKeyColumn(primaryKey, (SQLServerTableColumn) tableColumn, colIndex++));
}
return primaryKey;
});
}
Aggregations