pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rob stone <floriparob@gmail.com>
To: Vinodh NV <linktovinodh@gmail.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Require assistance in Postgres + Hibernate : Error: java.math.BigInteger cannot be cast to java.math.BigDecimal
Date: Tue, 13 Feb 2018 22:39:36 +1100
Message-ID: <1518521976.11296.1.camel@gmail.com> (raw)
In-Reply-To: <CAMBHpRjM-7o=ga7R0RKNwYtJN-0jHihhq_2gXQvKsb3fUH24hg@mail.gmail.com>
References: <CAMBHpRjM-7o=ga7R0RKNwYtJN-0jHihhq_2gXQvKsb3fUH24hg@mail.gmail.com>

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




view thread (6+ messages)  latest in thread

Message-ID: <1518521976.11296.1.camel@gmail.com>
Permalink:  ../1518521976.11296.1.camel@gmail.com/
Also on:    postgresql.org/message-id/1518521976.11296.1.camel@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: floriparob@gmail.com, linktovinodh@gmail.com
  Subject: Re: Require assistance in Postgres + Hibernate : Error: java.math.BigInteger cannot be cast to java.math.BigDecimal
  In-Reply-To: <1518521976.11296.1.camel@gmail.com>
  References: <CAMBHpRjM-7o=ga7R0RKNwYtJN-0jHihhq_2gXQvKsb3fUH24hg@mail.gmail.com> <1518521976.11296.1.camel@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox