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);