Skip to content

Commit

Permalink
新增数据库Wrapper支持反解
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Mar 28, 2024
1 parent c93e28d commit abfa378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 🚀Changelog

-------------------------------------------------------------------------------------------------------------
# 5.8.27(2024-03-26)
# 5.8.27(2024-03-28)

### 🐣新特性
* 【extra 】 FreemarkerEngine修改默认版本参数
Expand All @@ -11,6 +11,7 @@
* 【core 】 StrUtil.replace歧义,修改为replaceByCodePoint(issue#I96LWH@Gitee)
* 【core 】 FileUtil和PathUtil增加Resource重载(issue#I97FJT@Gitee)
* 【core 】 优化ThreadUtil.safeSleep,使用System.nanoTime()(issue#I9BMGK@Gitee)
* 【db 】 新增数据库Wrapper支持反解(pr#1192@Gitee)

### 🐞Bug修复
* 【core 】 修复PathMover对目标已存在且只读文件报错错误问题(issue#I95CLT@Gitee)
Expand Down
5 changes: 3 additions & 2 deletions hutool-db/src/main/java/cn/hutool/db/sql/Wrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ public String wrap(String field) {
}

/**
* 反解包装字段名<br>
* 解包装字段名<br>
*
* @param field 字段名
* @return 未包装的字段名
* @since 5.8.27
*/
public String unWrap(String field) {
if (preWrapQuote == null || sufWrapQuote == null || StrUtil.isBlank(field)) {
Expand All @@ -136,7 +137,7 @@ public String unWrap(String field) {
return field;
}

//如果字段中包含通配符或者括号(字段通配符或者函数),不做包装
//如果字段中包含通配符或者括号(字段通配符或者函数),不做解包装
if (StrUtil.containsAnyIgnoreCase(field, "*", "(", " ", " as ")) {
return field;
}
Expand Down

0 comments on commit abfa378

Please sign in to comment.