首页 > 编程语言 > 详细

java.math.BigInteger cannot be cast to java.lang.Long

时间:2015-07-28 14:49:50      阅读:258      评论:0      收藏:0      [点我收藏+]

mysql数据库

Biginteger 转换为Long类型时的错误


hibernate 的createSQLQuery("select count(*) from orders").uniqueResult() 返回的对象是BigInteger类型的

BigInteger totalCount = (BigInteger)this.getSession().createSQLQuery("select count(*) from orders.orders o, customer.customer c,orders.order_logistics ol where o.customerId=c.id and ol.id=o.collectionToolSendLogisticId and o.valid=true").uniqueResult();


totalCount.intValue()
totalCount.longValue()



createQuery返回的对象是Long类型的

Long totalCount = (Long)this.getSession().createQuery("select count(*) from Special s where s.valid=true").uniqueResult();


本文出自 “一无所有-天行者” 博客,请务必保留此出处http://tianxingzhe.blog.51cto.com/3390077/1679032

java.math.BigInteger cannot be cast to java.lang.Long

原文:http://tianxingzhe.blog.51cto.com/3390077/1679032

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!