Skip to content

Commit

Permalink
Merge branch 'dev' into 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chenrenfei committed Aug 28, 2024
2 parents a985b46 + 163b037 commit 16fbaa2
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 23 deletions.
6 changes: 3 additions & 3 deletions 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.20</version>
<version>5.6.21</version>
<name>sagacity-sqltoy</name>
<description>sqltoy core code</description>
<artifactId>sagacity-sqltoy</artifactId>
Expand All @@ -17,8 +17,8 @@
<elastic-rest-client.version>8.15.0</elastic-rest-client.version>
<fastjson.version>2.0.52</fastjson.version>
<mongo.version>3.12.14</mongo.version>
<junit-jupiter.version>5.10.3</junit-jupiter.version>
<junit-platform.version>1.10.3</junit-platform.version>
<junit-jupiter.version>5.11.0</junit-jupiter.version>
<junit-platform.version>1.11.0</junit-platform.version>
<slf4j.version>2.0.16</slf4j.version>
<h2.version>2.3.232</h2.version>
<lombok.version>1.18.34</lombok.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
public class Nvl extends IFunction {

private static Pattern regex = Pattern.compile("(?i)\\W(nvl|isnull|ifnull|coalesce)\\(");
private static Pattern regex = Pattern.compile("(?i)\\W(nvl|isnull|ifnull)\\(");

/*
* (non-Javadoc)
Expand Down Expand Up @@ -50,7 +50,7 @@ public String wrap(int dialect, String functionName, boolean hasArgs, String...
if (args == null || args.length == 0) {
return super.IGNORE;
}
String funLow = functionName.toLowerCase();
//String funLow = functionName.toLowerCase();
if (dialect == DBType.SQLSERVER) {
return wrapArgs("isnull", args);
}
Expand All @@ -72,10 +72,7 @@ public String wrap(int dialect, String functionName, boolean hasArgs, String...
return wrapArgs("nvl", args);
}
if (dialect == DBType.H2) {
if ("coalesce".equals(funLow)) {
return wrapArgs("coalesce", args);
}
return wrapArgs("ifnull", args);
return wrapArgs("coalesce", args);
}
return super.IGNORE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class BeanUtil {
private static ConcurrentHashMap<Class, Integer> enumGetKeyExists = new ConcurrentHashMap<Class, Integer>();
private static ConcurrentHashMap<String, Class> enumClassMap = new ConcurrentHashMap<String, Class>();

// 枚举类型取key值的常用方法名称
// 枚举类型取key值的常用方法名称,枚举类中用getValue、getKey、getId等作为取值的都可自动完成映射
private static String[] enumKeys = { "value", "key", "code", "id", "status", "level", "type" };

// 静态方法避免实例化和继承
Expand All @@ -103,6 +103,7 @@ public static Object getEnumValue(Object enumValue) {
Object result = null;
Class enumClass = enumValue.getClass();
Method getKeyMethod;
//Map缓存,不会每次都循环
if (enumGetKeyExists.containsKey(enumClass)) {
getKeyMethod = enumGetKeyMethods.get(enumClass);
if (getKeyMethod != null) {
Expand Down
40 changes: 40 additions & 0 deletions trunk/sqltoy-orm-solon-plugin/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 0 additions & 2 deletions trunk/sqltoy-orm-solon-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/target/
/bin/
/.settings/
/.classpath
.classpath
/.idea/
*.iml
sagacity-sqltoy.iml
4 changes: 2 additions & 2 deletions 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.20</version>
<version>5.6.21</version>

<artifactId>sagacity-sqltoy-solon-plugin</artifactId>
<name>sagacity-sqltoy-solon-plugin</name>
Expand All @@ -16,7 +16,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<solon.version>2.8.6</solon.version>
<solon.version>2.9.1</solon.version>
<redisx.version>1.6.5</redisx.version>
<mongo.version>3.12.14</mongo.version>
<slf4j.version>2.0.16</slf4j.version>
Expand Down
10 changes: 5 additions & 5 deletions trunk/sqltoy-orm-spring-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
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.20</version>
<version>5.6.21</version>
<name>sagacity-sqltoy-spring-starter</name>
<artifactId>sagacity-sqltoy-spring-starter</artifactId>
<description>sqltoy springboot starter</description>
<url>https://github.com/sagframe/sagacity-sqltoy</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>3.3.2</spring-boot.version>
<spring-data-commons.version>3.3.2</spring-data-commons.version>
<spring-data-redis.version>3.3.2</spring-data-redis.version>
<spring-data-mongo.version>4.3.2</spring-data-mongo.version>
<spring-boot.version>3.3.3</spring-boot.version>
<spring-data-commons.version>3.3.3</spring-data-commons.version>
<spring-data-redis.version>3.3.3</spring-data-redis.version>
<spring-data-mongo.version>4.3.3</spring-data-mongo.version>
<mongo.version>3.12.14</mongo.version>
<caffeine.version>3.1.8</caffeine.version>
</properties>
Expand Down
8 changes: 4 additions & 4 deletions trunk/sqltoy-orm-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
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.20</version>
<version>5.6.21</version>
<name>sagacity-sqltoy-spring</name>
<description>sagacity-sqltoy-spring</description>
<artifactId>sagacity-sqltoy-spring</artifactId>
<url>https://github.com/sagframe/sagacity-sqltoy</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-framework.version>6.1.12</spring-framework.version>
<spring-data-commons.version>3.3.2</spring-data-commons.version>
<spring-data-redis.version>3.3.2</spring-data-redis.version>
<spring-data-mongo.version>4.3.2</spring-data-mongo.version>
<spring-data-commons.version>3.3.3</spring-data-commons.version>
<spring-data-redis.version>3.3.3</spring-data-redis.version>
<spring-data-mongo.version>4.3.3</spring-data-mongo.version>
<mongo.version>3.12.14</mongo.version>
<slf4j.version>2.0.16</slf4j.version>
<caffeine.version>3.1.8</caffeine.version>
Expand Down

0 comments on commit 16fbaa2

Please sign in to comment.