利用删除表配置代替重置表配置,解决表配置不正确等问题。

This commit is contained in:
makejava 2022-07-06 15:30:58 +08:00
parent 8f93ef44a3
commit 8c6b4438e4
4 changed files with 28 additions and 1 deletions

View File

@ -119,7 +119,7 @@ public class MainActionGroup extends ActionGroup {
if (dbTable == null) {
return;
}
TableInfoSettingsService.getInstance().resetTableInfo(dbTable);
TableInfoSettingsService.getInstance().removeTableInfo(dbTable);
Messages.showInfoMessage(dbTable.getName() + "表配置信息已重置成功", GlobalDict.TITLE_INFO);
}
};

View File

@ -124,4 +124,14 @@ public class TableInfoSettingsDTO {
String key = generateKey(dbTable);
this.tableInfoMap.put(key, new TableInfoDTO(null, dbTable));
}
/**
* 删除表信息
*
* @param dbTable 数据库表
*/
public void removeTableInfo(DbTable dbTable) {
String key = generateKey(dbTable);
this.tableInfoMap.remove(key);
}
}

View File

@ -53,4 +53,11 @@ public interface TableInfoSettingsService extends PersistentStateComponent<Table
* @param dbTable 数据库表
*/
void resetTableInfo(DbTable dbTable);
/**
* 删除表信息
*
* @param dbTable 数据库表
*/
void removeTableInfo(DbTable dbTable);
}

View File

@ -74,4 +74,14 @@ public class TableInfoSettingsServiceImpl implements TableInfoSettingsService {
public void resetTableInfo(DbTable dbTable) {
Objects.requireNonNull(getState()).resetTableInfo(dbTable);
}
/**
* 删除表信息
*
* @param dbTable 数据库表
*/
@Override
public void removeTableInfo(DbTable dbTable) {
Objects.requireNonNull(getState()).removeTableInfo(dbTable);
}
}