mysql数据库BigInt数据类型和实体对象中BigInteger,Long类型的冲突
实体Bean
public class Broke {
/**
* brokeid
*/
BigInteger brokeid;
/**
* 节点id 与 节点id为多对一的关系
*/
String nodeid;
/**
* brokeip
*/
String brokeip;
/**
* 删除标记 0--notdelete 1--delete (0 is default)
*/
int deleteflag = 0;
}
brokeid为BigInteger类型, 在mysql数据库中brokeid同样也为BigInteger类型,看起来如果在数据库中查找相关Broke实体应该没有什么问题,然而在查找出resultSet结果进行反射时,却抛出了argument type mismatch的错误信息。。下面看反射代码。。
public static List getObjectsList(ResultSet rs, Class k)
throws SQLException {
List bl = new ArrayList();
if (rs != null) {
while (rs.next()) {
T o = null;
try {
o = k.newInstance();
for (Method m