原文:报错:java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.xxx.entity.PersonEntity

报错:java.lang.ClassCastException: Ljava.lang.Object cannot be cast to com.xxx.entity.PersonEntity 代码:SessionFactory sf this.getSessionFactory Session session sf.openSession SQLQuery createSQLQuery sess ...

2017-02-06 14:27 0 1668 推荐指数:

查看详情

java.math.BigDecimal cannot be cast to [Ljava.lang.Object;

从数据库中使用sum函数取出统计值后,放进list中,遍历list的时候强转化成Object报错。 BigDecimal 、Integer不是基本类型,是int的包装类,无法把包装当做基本类型来用。 只能转换成BigDecimal,然后toString ...

Sun Mar 10 08:40:00 CST 2019 0 605
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM