MySQL Database
Biginteger error when converting to a long type
Hibernate's Createsqlquery ("SELECT count (*) from Orders"). Uniqueresult () The object returned is of type 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 ()
The object returned by CreateQuery is a long type.
Long TotalCount = (long) this.getsession (). CreateQuery ("SELECT count (*) from special S where S.valid=true"). Uniqueresult ();
This article is from the "Nothing-skywalker" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1679032
Java.math.BigInteger cannot is cast to Java.lang.Long