use of org.jkiss.dbeaver.model.edit.DBEPersistAction in project dbeaver by dbeaver.
the class DB2SchemaManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
String schemaName = command.getObject().getName();
DBEPersistAction action = new SQLDatabasePersistAction("Drop schema (SQL)", String.format(SQL_DROP_SCHEMA, DBUtils.getQuotedIdentifier(command.getObject())));
actions.add(action);
}
use of org.jkiss.dbeaver.model.edit.DBEPersistAction in project dbeaver by dbeaver.
the class DB2TableColumnManager method addObjectModifyActions.
// -----
// Alter
// -----
@Override
protected void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command, Map<String, Object> options) {
DB2TableColumn db2Column = command.getObject();
boolean hasColumnChanges = false;
if (!command.getProperties().isEmpty()) {
final String deltaSQL = computeDeltaSQL(command);
if (!deltaSQL.isEmpty()) {
hasColumnChanges = true;
String sqlAlterColumn = String.format(SQL_ALTER, db2Column.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL), deltaSQL);
actionList.add(new SQLDatabasePersistAction(CMD_ALTER, sqlAlterColumn));
}
}
// Comment
DBEPersistAction commentAction = buildCommentAction(db2Column);
if (commentAction != null) {
actionList.add(commentAction);
}
if (hasColumnChanges) {
// Be Safe, Add a reorg action
actionList.add(buildReorgAction(db2Column));
}
}
use of org.jkiss.dbeaver.model.edit.DBEPersistAction in project dbeaver by serge-rider.
the class ExasolTableManager method addStructObjectCreateActions.
@Override
public void addStructObjectCreateActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, StructCreateCommand command, Map<String, Object> options) throws DBException {
super.addStructObjectCreateActions(monitor, executionContext, actions, command, options);
// Eventually add Comment
DBEPersistAction commentAction = buildCommentAction(command.getObject());
if (commentAction != null) {
actions.add(commentAction);
}
}
use of org.jkiss.dbeaver.model.edit.DBEPersistAction in project dbeaver by serge-rider.
the class DB2AbstractDropOnlyManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
DBEPersistAction action = new SQLDatabasePersistAction("Drop", buildDropStatement(command.getObject()));
actions.add(action);
}
use of org.jkiss.dbeaver.model.edit.DBEPersistAction in project dbeaver by serge-rider.
the class DB2SequenceManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
String sql = String.format(SQL_DROP, command.getObject().getFullyQualifiedName(DBPEvaluationContext.DDL));
DBEPersistAction action = new SQLDatabasePersistAction("Drop Sequence", sql);
actions.add(action);
}
Aggregations