From efdbba7f8a3fb838a5861bdae0013455348224e9 Mon Sep 17 00:00:00 2001 From: zhongxuchen Date: Tue, 19 Dec 2023 21:45:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/sqltoy-orm/pom.xml | 4 ++-- .../src/main/java/org/sagacity/sqltoy/SqlToyConstants.java | 3 ++- .../main/java/org/sagacity/sqltoy/config/SqlScriptLoader.java | 1 + trunk/sqltoy-spring-boot-starter/pom.xml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/sqltoy-orm/pom.xml b/trunk/sqltoy-orm/pom.xml index 00eafba7c..ba6d2106f 100644 --- a/trunk/sqltoy-orm/pom.xml +++ b/trunk/sqltoy-orm/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.sagframe - 5.2.86 + 5.2.87 sagacity-sqltoy sagacity-sqltoy sagacity-sqltoy @@ -18,7 +18,7 @@ 4.5.14 4.5.14 4.4.16 - 8.11.2 + 8.11.3 2.0.43 3.12.14 5.10.1 diff --git a/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/SqlToyConstants.java b/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/SqlToyConstants.java index 1c090609f..86e862b8a 100644 --- a/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/SqlToyConstants.java +++ b/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/SqlToyConstants.java @@ -160,8 +160,9 @@ public class SqlToyConstants { // update 2020-9-16 将\\W 替换为[^A-Za-z0-9_:] 增加排除: 适应::jsonb 这种模式场景 // update 2021-10-13 增加参数名称为中文场景(应对一些极为不规范的项目场景) // update 2023-8-17 增加支持:itemSet[0].paramName 模式(之前只支持:itemSet[0]) + // update 2023-12-19 去除_开始的匹配限制 public final static Pattern SQL_NAMED_PATTERN = Pattern.compile( - "[^A-Za-z0-9_:\u4e00-\u9fa5]\\:\\s*[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*(\\.[\\w\u4e00-\u9fa5]+)*(\\[\\d+\\](\\.[a-zA-Z0-9_\u4e00-\u9fa5]+)*)?\\s?"); + "[^A-Za-z0-9:\u4e00-\u9fa5]\\:\\s*[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*(\\.[\\w\u4e00-\u9fa5]+)*(\\[\\d+\\](\\.[a-zA-Z0-9_\u4e00-\u9fa5]+)*)?\\s?"); public final static Pattern NOSQL_NAMED_PATTERN = Pattern.compile( "(?i)\\@(param|blank|value)?\\(\\s*\\:\\s*[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*(\\.[\\w\u4e00-\u9fa5]+)*(\\[\\d+\\](\\.[a-zA-Z0-9_\u4e00-\u9fa5]+)*)?\\s*\\)"); diff --git a/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/config/SqlScriptLoader.java b/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/config/SqlScriptLoader.java index f3960d736..3e360d7c5 100644 --- a/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/config/SqlScriptLoader.java +++ b/trunk/sqltoy-orm/src/main/java/org/sagacity/sqltoy/config/SqlScriptLoader.java @@ -266,6 +266,7 @@ public SqlToyConfig getSqlConfig(String sqlKey, SqlType sqlType, String dialect, // 复制一份,避免直接修改sql缓存中的模型 if (isParamInclude) { result = result.clone(); + result.clearDialectSql(); } // 替换include的实际sql String sql = MacroUtils.replaceMacros(result.getSql(), (Map) sqlCache, paramValues, false, macros); diff --git a/trunk/sqltoy-spring-boot-starter/pom.xml b/trunk/sqltoy-spring-boot-starter/pom.xml index bf5323735..06c4c514f 100644 --- a/trunk/sqltoy-spring-boot-starter/pom.xml +++ b/trunk/sqltoy-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.sagframe - 5.2.86 + 5.2.87 sagacity-sqltoy-starter sagacity-sqltoy-starter sqltoy springboot starter From 87fc8da4c7e4df63f8028126777277d1bba0f490 Mon Sep 17 00:00:00 2001 From: zhongxuchen Date: Tue, 19 Dec 2023 21:47:21 +0800 Subject: [PATCH 2/2] Update pom.xml --- trunk/sqltoy-spring-boot-starter/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/sqltoy-spring-boot-starter/pom.xml b/trunk/sqltoy-spring-boot-starter/pom.xml index 06c4c514f..d32d550ca 100644 --- a/trunk/sqltoy-spring-boot-starter/pom.xml +++ b/trunk/sqltoy-spring-boot-starter/pom.xml @@ -12,7 +12,7 @@ UTF-8 2.7.18 - 5.2.86 + 5.2.87