我正在使用uniqueresult()
类中的org.hibernate.Query
方法,其返回类型为Object
。
在我的情况下,我在BigDecimal
课程中持有此结果。现在,这是抛出ClassCastException ( java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer)
。
我也试过了BigInteger
,也是同样的例外。
请告诉你如何施展这种结果。
答案 0 :(得分:-1)
如果你想从Integer获得BigDecimal,你必须这样做:
{{1}}