Java:无法把数据库字段类型bigint转化为java的long类型
错误提示如下所示:
- Can not set java.lang.Long field com.bigdata.plus.Entity.DatabaseInfo.tableRows to java.math.BigInteger
- Cannot invoke com.bigdata.plus.Entity.DatabaseInfo.setTableRows on bean class ‘class com.bigdata.plus.Entity.DatabaseInfo’ - argument type mismatch - had objects of type “java.math.BigInteger” but expected signature “java.lang.Long”
解决方法如下所示:
- 把BigInteger转化为long类型
if("java.math.BigInteger".equals(columnValue