mirror of
https://github.com/CarmJos/EasySQL.git
synced 2026-06-04 15:28:20 +08:00
[0.3.5] 修复 ConditionalBuilder 对于参数未添加 AND 链接的问题
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -120,9 +120,9 @@ public abstract class AbstractConditionalBuilder<B extends ConditionalBuilder<B,
|
|||||||
Iterator<String> iterator = conditionSQLs.iterator();
|
Iterator<String> iterator = conditionSQLs.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
conditionBuilder.append(iterator.next());
|
conditionBuilder.append(iterator.next());
|
||||||
if (iterator.hasNext()) conditionBuilder.append(" ");
|
if (iterator.hasNext()) conditionBuilder.append(" AND ");
|
||||||
}
|
}
|
||||||
return conditionBuilder.toString();
|
return conditionBuilder.toString().trim();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.parent.groupId}</groupId>
|
<groupId>${project.parent.groupId}</groupId>
|
||||||
<artifactId>easysql-hikaricp</artifactId>
|
<artifactId>easysql-beecp</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package cc.carm.lib.easysql.testrunner;
|
|||||||
|
|
||||||
import cc.carm.lib.easysql.EasySQL;
|
import cc.carm.lib.easysql.EasySQL;
|
||||||
import cc.carm.lib.easysql.api.SQLManager;
|
import cc.carm.lib.easysql.api.SQLManager;
|
||||||
|
import cc.carm.lib.easysql.testrunner.tests.DeleteTest;
|
||||||
import cc.carm.lib.easysql.testrunner.tests.QueryCloseTest;
|
import cc.carm.lib.easysql.testrunner.tests.QueryCloseTest;
|
||||||
import cc.carm.lib.easysql.testrunner.tests.QueryFunctionTest;
|
import cc.carm.lib.easysql.testrunner.tests.QueryFunctionTest;
|
||||||
import cc.carm.lib.easysql.testrunner.tests.TableCreateTest;
|
import cc.carm.lib.easysql.testrunner.tests.TableCreateTest;
|
||||||
@@ -49,6 +50,7 @@ public class Main {
|
|||||||
// tests.add(new SQLUpdateBatchTests());
|
// tests.add(new SQLUpdateBatchTests());
|
||||||
// tests.add(new SQLUpdateReturnKeysTest());
|
// tests.add(new SQLUpdateReturnKeysTest());
|
||||||
tests.add(new QueryFunctionTest());
|
tests.add(new QueryFunctionTest());
|
||||||
|
tests.add(new DeleteTest());
|
||||||
|
|
||||||
print("准备进行测试...");
|
print("准备进行测试...");
|
||||||
|
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package cc.carm.lib.easysql.testrunner.tests;
|
||||||
|
|
||||||
|
import cc.carm.lib.easysql.api.SQLManager;
|
||||||
|
import cc.carm.lib.easysql.testrunner.EasySQLTest;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class DeleteTest extends EasySQLTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTest(SQLManager sqlManager) throws SQLException {
|
||||||
|
|
||||||
|
Integer changes = sqlManager.createDelete("test_user_table")
|
||||||
|
.addCondition("id", ">", 5)
|
||||||
|
.addNotNullCondition("username")
|
||||||
|
.build().execute();
|
||||||
|
|
||||||
|
System.out.println("change(s): " + changes);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,8 +5,9 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>11</maven.compiler.source>
|
<java.version>8</java.version>
|
||||||
<maven.compiler.target>11</maven.compiler.target>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
<sonar.organization>carmjos</sonar.organization>
|
<sonar.organization>carmjos</sonar.organization>
|
||||||
@@ -16,7 +17,7 @@
|
|||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>easysql-api</module>
|
<module>easysql-api</module>
|
||||||
@@ -198,8 +199,8 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.9.0</version>
|
<version>3.9.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>${java.version}</source>
|
||||||
<target>1.8</target>
|
<target>${java.version}</target>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<compilerArgument>-parameters</compilerArgument>
|
<compilerArgument>-parameters</compilerArgument>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>easysql-parent</artifactId>
|
<artifactId>easysql-parent</artifactId>
|
||||||
<groupId>cc.carm.lib</groupId>
|
<groupId>cc.carm.lib</groupId>
|
||||||
<version>0.3.4</version>
|
<version>0.3.5</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
<!--项目地址 https://github.com/brettwooldridge/HikariCP/ -->
|
<!--项目地址 https://github.com/brettwooldridge/HikariCP/ -->
|
||||||
<groupId>com.zaxxer</groupId>
|
<groupId>com.zaxxer</groupId>
|
||||||
<artifactId>HikariCP</artifactId>
|
<artifactId>HikariCP</artifactId>
|
||||||
<version>5.0.1</version>
|
<version>4.0.3</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
Reference in New Issue
Block a user