未验证 提交 437bdc7b 编写于 作者: 小东 提交者: Gitee

!52 oracle 存储表数据时,前端修改接口名称会出现同名保存不上的异常

Merge pull request !52 from Bin/master
......@@ -139,7 +139,9 @@ public class DatabaseResource extends KeyValueResource {
public boolean renameTo(Map<String, String> renameKeys) {
List<Object[]> args = renameKeys.entrySet().stream().map(entry -> new Object[]{entry.getValue(), entry.getKey()}).collect(Collectors.toList());
String sql = String.format("update %s set file_path = ? where file_path = ?", tableName);
if (Arrays.stream(template.batchUpdate(sql, args)).sum() > 0) {
int affectedRows = Arrays.stream(template.batchUpdate(sql, args)).sum() ;
//oracle 执行更新操作成功会返回-2
if (affectedRows > 0 || affectedRows == -2) {
renameKeys.forEach((oldKey, newKey) -> this.cachedContent.put(newKey, this.cachedContent.remove(oldKey)));
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册