Browse Source

REPORT-134411 DataOperatorProvider接口适配Connection 优化部分写法

fbp/merge
Destiny.Lin 3 months ago
parent
commit
37b6ed5787
  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
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() {
String name = connectionTableProcedurePane.getSelectedDatabaseConnnectonName();
if (StringUtils.isEmpty(name)) {
return false;
}
Connection connection = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(connectionTableProcedurePane.getSelectedDatabaseConnnectonName()));
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) {
clearCache(datasource);
}
return processDataInAnotherThread(databaseName, searchFilter, typesFilter);
return processDataInAnotherThread(datasource, searchFilter, typesFilter);
}
@Override
@ -166,9 +166,8 @@ public class TableViewList extends UIList {
* @param searchFilter
* @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();
Connection datasource = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(databaseName));
if (datasource == null) {
return defaultListModel;
}
@ -177,7 +176,7 @@ public class TableViewList extends UIList {
searchFilter = searchFilter.toLowerCase();
boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace();
// oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(databaseName, isOracleSystemSpace);
DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource.getConnectionName(), isOracleSystemSpace);
if (ArrayUtils.isNotEmpty(detail.getSchemas())) {
schemas = detail.getSchemas();
}

Loading…
Cancel
Save