我收到以下异常。java.math.BigInteger不能转换为java.lang.Integer
所致:
java.lang.ClassCastException:java.math.BigInteger中不能转换到 java.lang.Integer中
用下面的代码
List queryResult = query.list();
for (Iterator<Object[]> it = queryResult.iterator(); it.hasNext();) {
Object[] result = it.next();
Integer childId = (Integer) result[0];
Integer grandChildCount = (Integer) result[1];
CompanyNode childNode = childNodes.get(childId);
childNode.setHasChildren(grandChildCount != 0);
childNode.setIsLeaf(grandChildCount == 0);
}
at this line
Integer grandChildCount = (Integer) result[1];
有人有什么想法吗?
谢谢大家,我现在在生产中试用它,希望它现在可以工作。 – 2012-03-01 05:34:30