|
|
@ -156,7 +156,12 @@ public class TableDataBeanHelper { |
|
|
|
if (dataSet.getDatabase() instanceof NameDatabaseConnection) { |
|
|
|
if (dataSet.getDatabase() instanceof NameDatabaseConnection) { |
|
|
|
bean.setDatabase(((NameDatabaseConnection) dataSet.getDatabase()).getName()); |
|
|
|
bean.setDatabase(((NameDatabaseConnection) dataSet.getDatabase()).getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (dataSet.getQuery() != null) { |
|
|
|
bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery())); |
|
|
|
bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (dataSet.getPageQuerySql() != null) { |
|
|
|
|
|
|
|
bean.setPageQuery(DataEncryptionHelper.encrypt(dataSet.getPageQuerySql())); |
|
|
|
|
|
|
|
} |
|
|
|
List<ParameterBean> parameterBeans = new ArrayList<>(); |
|
|
|
List<ParameterBean> parameterBeans = new ArrayList<>(); |
|
|
|
ParameterProvider[] parameters = dataSet.getParameters(Calculator.createCalculator()); |
|
|
|
ParameterProvider[] parameters = dataSet.getParameters(Calculator.createCalculator()); |
|
|
|
for (ParameterProvider parameter : parameters) { |
|
|
|
for (ParameterProvider parameter : parameters) { |
|
|
@ -186,7 +191,12 @@ public class TableDataBeanHelper { |
|
|
|
private static TableData deserialize4SQL(Map<String, Connection> connectionMap, DBTableData oldDataSet, JSONObject object) { |
|
|
|
private static TableData deserialize4SQL(Map<String, Connection> connectionMap, DBTableData oldDataSet, JSONObject object) { |
|
|
|
DBTableData tableData = new DBTableData(); |
|
|
|
DBTableData tableData = new DBTableData(); |
|
|
|
SQLDataSetBean bean = object.mapTo(SQLDataSetBean.class); |
|
|
|
SQLDataSetBean bean = object.mapTo(SQLDataSetBean.class); |
|
|
|
|
|
|
|
if (bean.getQuery() != null) { |
|
|
|
tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery())); |
|
|
|
tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (bean.getPageQuery() != null) { |
|
|
|
|
|
|
|
tableData.setPageQuerySql(DataEncryptionHelper.decrypt(bean.getPageQuery())); |
|
|
|
|
|
|
|
} |
|
|
|
Connection connection = connectionMap.get(bean.getDatabase()); |
|
|
|
Connection connection = connectionMap.get(bean.getDatabase()); |
|
|
|
if (connection != null) { |
|
|
|
if (connection != null) { |
|
|
|
tableData.setDatabase(new NameDatabaseConnection(bean.getDatabase())); |
|
|
|
tableData.setDatabase(new NameDatabaseConnection(bean.getDatabase())); |
|
|
|