From 7a2d1841db6c0e0136aedd5cbb62dd18e5cb6df1 Mon Sep 17 00:00:00 2001 From: CarmJos Date: Sat, 5 Feb 2022 12:07:45 +0800 Subject: [PATCH] =?UTF-8?q?[0.3.6]=20=E6=9E=9A=E4=B8=BE=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=87=87=E7=94=A8=20name()=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easysql-api/pom.xml | 2 +- easysql-impl/pom.xml | 2 +- .../main/java/cc/carm/lib/easysql/util/StatementUtil.java | 6 ++++++ example/easysql-demo/pom.xml | 2 +- example/easysql-test/pom.xml | 2 +- pom.xml | 2 +- with-pool/easysql-beecp/pom.xml | 2 +- with-pool/easysql-hikaricp/pom.xml | 2 +- 8 files changed, 13 insertions(+), 7 deletions(-) diff --git a/easysql-api/pom.xml b/easysql-api/pom.xml index 6dc9958..258ff05 100644 --- a/easysql-api/pom.xml +++ b/easysql-api/pom.xml @@ -5,7 +5,7 @@ cc.carm.lib easysql-parent - 0.3.5 + 0.3.6 4.0.0 diff --git a/easysql-impl/pom.xml b/easysql-impl/pom.xml index 9e31a42..be0576c 100644 --- a/easysql-impl/pom.xml +++ b/easysql-impl/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.3.5 + 0.3.6 4.0.0 diff --git a/easysql-impl/src/main/java/cc/carm/lib/easysql/util/StatementUtil.java b/easysql-impl/src/main/java/cc/carm/lib/easysql/util/StatementUtil.java index abeec94..7d9fdcf 100644 --- a/easysql-impl/src/main/java/cc/carm/lib/easysql/util/StatementUtil.java +++ b/easysql-impl/src/main/java/cc/carm/lib/easysql/util/StatementUtil.java @@ -197,6 +197,12 @@ public class StatementUtil { // 其它数字类型按照默认类型传入 } + if (param instanceof Enum) { + //枚举类采用 name() + preparedStatement.setString(paramIndex, ((Enum) param).name()); + return; + } + // 其它参数类型直接传入 preparedStatement.setObject(paramIndex, param); } diff --git a/example/easysql-demo/pom.xml b/example/easysql-demo/pom.xml index 7ed25a8..a36abd3 100644 --- a/example/easysql-demo/pom.xml +++ b/example/easysql-demo/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.3.5 + 0.3.6 ../../pom.xml 4.0.0 diff --git a/example/easysql-test/pom.xml b/example/easysql-test/pom.xml index c2a8808..c8f3eb6 100644 --- a/example/easysql-test/pom.xml +++ b/example/easysql-test/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.3.5 + 0.3.6 ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 838ebf1..6291015 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ cc.carm.lib easysql-parent pom - 0.3.5 + 0.3.6 easysql-api diff --git a/with-pool/easysql-beecp/pom.xml b/with-pool/easysql-beecp/pom.xml index 0ab3f09..56e6502 100644 --- a/with-pool/easysql-beecp/pom.xml +++ b/with-pool/easysql-beecp/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.3.5 + 0.3.6 ../../pom.xml 4.0.0 diff --git a/with-pool/easysql-hikaricp/pom.xml b/with-pool/easysql-hikaricp/pom.xml index 4124c82..f82c84e 100644 --- a/with-pool/easysql-hikaricp/pom.xml +++ b/with-pool/easysql-hikaricp/pom.xml @@ -5,7 +5,7 @@ easysql-parent cc.carm.lib - 0.3.5 + 0.3.6 ../../pom.xml 4.0.0