Require assistance in Postgres + Hibernate : Error: java.math.BigInteger cannot be cast to java.math.BigDecimal

From: Vinodh NV <linktovinodh(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Require assistance in Postgres + Hibernate : Error: java.math.BigInteger cannot be cast to java.math.BigDecimal
Date: 2018-02-13 08:58:03
Message-ID: CAMBHpRjM-7o=ga7R0RKNwYtJN-0jHihhq_2gXQvKsb3fUH24hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Require assistance on the below:

Code snippet:
Map<String,Object> ic;
//Populate values for ic
long count = ((BigDecimal)ic.get(“EB”)).longValue();

Getting the below error:
java.math.BigInteger cannot be cast to java.math.BigDecimal
®java.lang.ClassCastException: java.math.BigInteger cannot be cast to
java.math.BigDecimal

Since this is not part of a query doing select cast (EB as bigint) will not
help in this case:

Can u let me know the solution for this?

Regards,
Vinodh

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luis Carril 2018-02-13 09:05:04 Re: Trying to the behavior of a parallel query with with a change in the transaction isolation mode
Previous Message Laurenz Albe 2018-02-13 08:31:44 Re: oracle_fdw Question