From a54beed05b70b415e4fa0403d9396af82ebc0ff4 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 1 Jan 2020 22:19:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=9C=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- panda-jdbc/src/main/java/org/panda/jdbc/BeanHander.java | 6 +----- .../src/main/java/org/panda/jdbc/BeanListHandler.java | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/panda-jdbc/src/main/java/org/panda/jdbc/BeanHander.java b/panda-jdbc/src/main/java/org/panda/jdbc/BeanHander.java index 864b7b6..335e9ec 100644 --- a/panda-jdbc/src/main/java/org/panda/jdbc/BeanHander.java +++ b/panda-jdbc/src/main/java/org/panda/jdbc/BeanHander.java @@ -3,10 +3,8 @@ package org.panda.jdbc; import org.panda.beans.util.BeanUtil; import org.panda.code.uitl.ReflectionUtil; -import org.panda.jdbc.annotation.Column; import org.panda.jdbc.sql.BeanSqlUtil; import java.lang.reflect.Field; -import java.lang.reflect.Method; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; @@ -29,9 +27,7 @@ public class BeanHander implements ResultSetHandler { try { Object bean = BeanUtil.instantiateClass(clazz); - ResultSetMetaData metadata = rs.getMetaData(); - //数据总数 - int coulumnCount = metadata.getColumnCount(); + List fieldList = BeanUtil.getAllField(clazz); for (Field f:fieldList){ diff --git a/panda-jdbc/src/main/java/org/panda/jdbc/BeanListHandler.java b/panda-jdbc/src/main/java/org/panda/jdbc/BeanListHandler.java index 7891081..fe240b6 100644 --- a/panda-jdbc/src/main/java/org/panda/jdbc/BeanListHandler.java +++ b/panda-jdbc/src/main/java/org/panda/jdbc/BeanListHandler.java @@ -1,6 +1,7 @@ package org.panda.jdbc; import java.sql.ResultSet; +import java.sql.ResultSetMetaData; import java.util.ArrayList; import java.util.List; @@ -23,6 +24,9 @@ public class BeanListHandler implements ResultSetHandler { public Object handler(ResultSet rs) { try { +// ResultSetMetaData metadata = rs.getMetaData(); + //数据总数 +// int coulumnCount = metadata.getColumnCount(); List list = new ArrayList<>(); while (rs.next()) { Object bean = resultSetHandler.handler(rs);