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

Поиск
Список
Период
Сортировка
От rob stone
Тема Re: Require assistance in Postgres + Hibernate : Error:java.math.BigInteger cannot be cast to java.math.BigDecimal
Дата
Msg-id 1518521976.11296.1.camel@gmail.com
обсуждение исходный текст
Ответ на Require assistance in Postgres + Hibernate : Error:java.math.BigInteger cannot be cast to java.math.BigDecimal  (Vinodh NV <linktovinodh@gmail.com>)
Ответы Re: Require assistance in Postgres + Hibernate : Error:java.math.BigInteger cannot be cast to java.math.BigDecimal  (Francisco Olarte <folarte@peoplecall.com>)
Список pgsql-general
Hi,

On Tue, 2018-02-13 at 14:28 +0530, Vinodh NV wrote:
> 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


This is not a Postgres question per se.

The method is documented as:-

public static BigDecimal valueOf(long val)


HTH,
Rob


В списке pgsql-general по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: session_replication_role meaning?
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: Require assistance in Postgres + Hibernate : Error:java.math.BigInteger cannot be cast to java.math.BigDecimal