Skip to content

Commit

Permalink
兼容历史主键包路径
Browse files Browse the repository at this point in the history
  • Loading branch information
chenrenfei committed Jul 31, 2024
1 parent e82439c commit 52008e2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sagframe</groupId>
<version>5.6.15</version>
<version>5.6.16</version>
<name>sagacity-sqltoy</name>
<description>sqltoy core code</description>
<artifactId>sagacity-sqltoy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public class EntityManager {
private static final String IdGeneratorPackage = "org.sagacity.sqltoy.plugins.id.impl.";
// 历史id主键策略的包路径,5.x版本开始剔除了兼容处理,2024-7-16日增加了兼容处理
private static final String IdGeneratorOldPackage = "org.sagacity.sqltoy.plugin.id.";
private static final String IdGeneratorOldPackage_v1 = "org.sagacity.sqltoy.plugins.id.";

/**
* 扫描的包(意义不大,sqltoy已经改为在使用时自动加载)
Expand Down Expand Up @@ -783,7 +784,8 @@ private void processIdGenerator(SqlToyContext sqlToyContext, EntityMeta entityMe
String generator = IdGenerators.get(idGenerator.toLowerCase());
generator = (generator != null) ? IdGeneratorPackage.concat(generator) : idGenerator;
// 针对历史id策略包路径提供兼容处理:update 2024-07-16
if (generator.startsWith(IdGeneratorOldPackage)) {
if (generator.startsWith(IdGeneratorOldPackage)
|| (generator.startsWith(IdGeneratorOldPackage_v1) && !generator.startsWith(IdGeneratorPackage))) {
generator = IdGeneratorPackage.concat(generator.substring(generator.lastIndexOf(".") + 1));
}
// 自定义(不依赖spring模式),用法在quickvo中配置例如:com.xxxx..CustomIdGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ public static Serializable load(final SqlToyContext sqlToyContext, SqlToyConfig
Serializable result = null;
// 加载主表
if (!onlySubTables) {
SqlConfigParseUtils.processSql(sql, entityMeta.getIdArray(), pkValues, null);
sqlToyResult = SqlConfigParseUtils.processSql(sql, entityMeta.getIdArray(), pkValues, null);
// 加密字段解密
DecryptHandler decryptHandler = null;
if (entityMeta.getSecureColumns() != null) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-solon-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.sagframe</groupId>
<version>5.6.15</version>
<version>5.6.16</version>

<artifactId>sagacity-sqltoy-solon-plugin</artifactId>
<name>sagacity-sqltoy-solon-plugin</name>
Expand Down
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-spring-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sagframe</groupId>
<version>5.6.15</version>
<version>5.6.16</version>
<name>sagacity-sqltoy-spring-starter</name>
<artifactId>sagacity-sqltoy-spring-starter</artifactId>
<description>sqltoy springboot starter</description>
Expand Down
2 changes: 1 addition & 1 deletion trunk/sqltoy-orm-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sagframe</groupId>
<version>5.6.15</version>
<version>5.6.16</version>
<name>sagacity-sqltoy-spring</name>
<description>sagacity-sqltoy-spring</description>
<artifactId>sagacity-sqltoy-spring</artifactId>
Expand Down

0 comments on commit 52008e2

Please sign in to comment.