Browse Source

Pull request #14810: REPORT-134411 DataOperatorProvider接口适配Connection 优化部分写法

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release

* commit '37b6ed578759078614e1494d826e74f83d4eea56':
  REPORT-134411 DataOperatorProvider接口适配Connection 优化部分写法
fbp/release
Destiny.Lin-林锦龙 3 months ago
parent
commit
b186d43817
  1. 2
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  3. 7
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

2
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -1022,7 +1022,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dgEdit(getTableDataInstance().creatTableDataPane(), createDsName(getNamePrefix()), false); DesignCacheManager.processByCacheTableData(() -> dgEdit(getTableDataInstance().creatTableDataPane(), createDsName(getNamePrefix()), false));
} }
} }

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -188,6 +188,10 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
} }
private boolean isAutoParameterDatabase() { private boolean isAutoParameterDatabase() {
String name = connectionTableProcedurePane.getSelectedDatabaseConnnectonName();
if (StringUtils.isEmpty(name)) {
return false;
}
Connection connection = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(connectionTableProcedurePane.getSelectedDatabaseConnnectonName())); Connection connection = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(connectionTableProcedurePane.getSelectedDatabaseConnnectonName()));
return connection != null && ArrayUtils.contains(DRIVERS, connection.getDriver()); return connection != null && ArrayUtils.contains(DRIVERS, connection.getDriver());
} }

7
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -123,7 +123,7 @@ public class TableViewList extends UIList {
if (refresh) { if (refresh) {
clearCache(datasource); clearCache(datasource);
} }
return processDataInAnotherThread(databaseName, searchFilter, typesFilter); return processDataInAnotherThread(datasource, searchFilter, typesFilter);
} }
@Override @Override
@ -166,9 +166,8 @@ public class TableViewList extends UIList {
* @param searchFilter * @param searchFilter
* @param typesFilter * @param typesFilter
*/ */
private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception { private DefaultListModel processDataInAnotherThread(Connection datasource, String searchFilter, String... typesFilter) throws Exception {
DefaultListModel defaultListModel = new DefaultListModel(); DefaultListModel defaultListModel = new DefaultListModel();
Connection datasource = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(databaseName));
if (datasource == null) { if (datasource == null) {
return defaultListModel; return defaultListModel;
} }
@ -177,7 +176,7 @@ public class TableViewList extends UIList {
searchFilter = searchFilter.toLowerCase(); searchFilter = searchFilter.toLowerCase();
boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace(); boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace();
// oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表) // oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(databaseName, isOracleSystemSpace); DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource.getConnectionName(), isOracleSystemSpace);
if (ArrayUtils.isNotEmpty(detail.getSchemas())) { if (ArrayUtils.isNotEmpty(detail.getSchemas())) {
schemas = detail.getSchemas(); schemas = detail.getSchemas();
} }

Loading…
Cancel
Save