将int转换为BigInteger

时间:2017-10-09 10:24:02

标签: java hibernate core

我正在使用uniqueresult()类中的org.hibernate.Query方法,其返回类型为Object

在我的情况下,我在BigDecimal课程中持有此结果。现在,这是抛出ClassCastException ( java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Integer)

我也试过了BigInteger,也是同样的例外。

请告诉你如何施展这种结果。

1 个答案:

答案 0 :(得分:-1)

如果你想从Integer获得BigDecimal,你必须这样做:

{{1}}