From 6f15897eb4afbc4f31691550abcd4b30fdf295a5 Mon Sep 17 00:00:00 2001 From: carm Date: Wed, 15 Mar 2023 23:07:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(query):=20=E6=B7=BB=E5=8A=A0=20`containsRe?= =?UTF-8?q?sult(column)`=20=E4=BB=A5=E4=BE=BF=E5=BF=AB=E9=80=9F=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=BB=93=E6=9E=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/pom.xml | 2 +- api/src/main/java/cc/carm/lib/easysql/api/SQLQuery.java | 5 +++++ demo/pom.xml | 2 +- impl/pom.xml | 2 +- pom.xml | 2 +- with-pool/beecp/pom.xml | 2 +- with-pool/hikaricp/pom.xml | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index f696014..6f379e4 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,7 +5,7 @@ cc.carm.lib easysql-parent - 0.4.6 + 0.4.7 4.0.0 diff --git a/api/src/main/java/cc/carm/lib/easysql/api/SQLQuery.java b/api/src/main/java/cc/carm/lib/easysql/api/SQLQuery.java index 70a43be..c3cacf9 100644 --- a/api/src/main/java/cc/carm/lib/easysql/api/SQLQuery.java +++ b/api/src/main/java/cc/carm/lib/easysql/api/SQLQuery.java @@ -5,6 +5,7 @@ import cc.carm.lib.easysql.api.action.query.QueryAction; import java.sql.Connection; import java.sql.ResultSet; +import java.sql.SQLException; import java.sql.Statement; import java.util.concurrent.TimeUnit; @@ -50,6 +51,10 @@ public interface SQLQuery extends AutoCloseable { ResultSet getResultSet(); + default boolean containsResult(String columnName) throws SQLException { + return getResultSet() != null && getResultSet().getObject(columnName) != null; + } + /** * 得到设定的SQL语句 * diff --git a/demo/pom.xml b/demo/pom.xml index 9d60ddd..a93434d 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.4.6 + 0.4.7 4.0.0 diff --git a/impl/pom.xml b/impl/pom.xml index 652e4eb..9d8ab90 100644 --- a/impl/pom.xml +++ b/impl/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.4.6 + 0.4.7 4.0.0 diff --git a/pom.xml b/pom.xml index 35fad4f..58afa88 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ cc.carm.lib easysql-parent pom - 0.4.6 + 0.4.7 api diff --git a/with-pool/beecp/pom.xml b/with-pool/beecp/pom.xml index bd3e51f..b98a487 100644 --- a/with-pool/beecp/pom.xml +++ b/with-pool/beecp/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.4.6 + 0.4.7 ../../pom.xml 4.0.0 diff --git a/with-pool/hikaricp/pom.xml b/with-pool/hikaricp/pom.xml index a431337..91a4c0c 100644 --- a/with-pool/hikaricp/pom.xml +++ b/with-pool/hikaricp/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.4.6 + 0.4.7 ../../pom.xml 4.0.0