Skip to content

Commit

Permalink
feat(query): 添加 containsResult(column) 以便快速验证结果。
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Mar 15, 2023
1 parent 4b4215f commit 6f15897
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-parent</artifactId>
<version>0.4.6</version>
<version>0.4.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
5 changes: 5 additions & 0 deletions api/src/main/java/cc/carm/lib/easysql/api/SQLQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -50,6 +51,10 @@ default long getExecuteTime() {

ResultSet getResultSet();

default boolean containsResult(String columnName) throws SQLException {
return getResultSet() != null && getResultSet().getObject(columnName) != null;
}

/**
* 得到设定的SQL语句
*
Expand Down
2 changes: 1 addition & 1 deletion demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.4.6</version>
<version>0.4.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.4.6</version>
<version>0.4.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-parent</artifactId>
<packaging>pom</packaging>
<version>0.4.6</version>
<version>0.4.7</version>

<modules>
<module>api</module>
Expand Down
2 changes: 1 addition & 1 deletion with-pool/beecp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.4.6</version>
<version>0.4.7</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion with-pool/hikaricp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.4.6</version>
<version>0.4.7</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down

0 comments on commit 6f15897

Please sign in to comment.