提交 c5b14dd2 编写于 作者: A Anastasiya Volkova

#9579 set description method fix


Former-commit-id: fae284f0
上级 2c407a76
......@@ -183,7 +183,11 @@ public class PostgreDatabaseManager extends SQLObjectEditor<PostgreDatabase, Pos
protected void addObjectExtraActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, NestedObjectCommand<PostgreDatabase, PropertyHandler> command, Map<String, Object> options) throws DBException {
if (command.hasProperty(DBConstants.PROP_ID_DESCRIPTION)) {
PostgreDatabase database = command.getObject();
actions.add(new SQLDatabasePersistAction("COMMENT ON DATABASE " + DBUtils.getQuotedIdentifier(database) + " IS " + SQLUtils.quoteString(database, database.getDescription(monitor))));
String description = database.getDescription();
if (description == null) {
description = "";
}
actions.add(new SQLDatabasePersistAction("COMMENT ON DATABASE " + DBUtils.getQuotedIdentifier(database) + " IS " + SQLUtils.quoteString(database, description)));
}
}
......
......@@ -72,7 +72,7 @@ public class PostgreMViewManager extends PostgreViewManager {
@Override
protected void addObjectModifyActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actionList, ObjectChangeCommand command, Map<String, Object> options) throws DBException {
final PostgreMaterializedView mView = (PostgreMaterializedView) command.getObject();
if (!command.hasProperty(DBConstants.PROP_ID_DESCRIPTION) || command.hasProperty(DBConstants.PROP_ID_DESCRIPTION) && command.getProperties().size() > 1) {
if (!command.hasProperty(DBConstants.PROP_ID_DESCRIPTION) || command.getProperties().size() > 1) {
super.addObjectDeleteActions(monitor, executionContext, actionList, new ObjectDeleteCommand(mView, "Drop view"), options);
super.addObjectModifyActions(monitor, executionContext, actionList, command, options);
}
......
......@@ -90,7 +90,7 @@ public class PostgreViewManager extends PostgreTableManagerBase implements DBEOb
@Override
protected void addObjectModifyActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actionList, ObjectChangeCommand command, Map<String, Object> options) throws DBException {
if (!command.hasProperty(DBConstants.PROP_ID_DESCRIPTION) || command.hasProperty(DBConstants.PROP_ID_DESCRIPTION) && command.getProperties().size() > 1) {
if (!command.hasProperty(DBConstants.PROP_ID_DESCRIPTION) || command.getProperties().size() > 1) {
createOrReplaceViewQuery(monitor, actionList, (PostgreViewBase) command.getObject(), options);
}
}
......
......@@ -282,11 +282,7 @@ public class PostgreDatabase extends JDBCRemoteInstance
}
public void setDescription(String description) {
if (description == null) {
this.description = "";
} else {
this.description = description;
}
this.description = description;
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册