Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elYwA-0004He-3L for pgsql-general@arkaria.postgresql.org; Tue, 13 Feb 2018 11:39:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elYw8-0000Mn-Fi for pgsql-general@arkaria.postgresql.org; Tue, 13 Feb 2018 11:39:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elYw8-0000Md-4Z for pgsql-general@lists.postgresql.org; Tue, 13 Feb 2018 11:39:48 +0000 Received: from mail-pg0-x235.google.com ([2607:f8b0:400e:c05::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1elYw5-00037P-7n for pgsql-general@postgresql.org; Tue, 13 Feb 2018 11:39:47 +0000 Received: by mail-pg0-x235.google.com with SMTP id a11so9689409pgu.13 for ; Tue, 13 Feb 2018 03:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=Kcr9awMG6rk5zGzBMV6o9pl39zVUeKAy9YXOa3If7mQ=; b=TjKOr1qFaV+OxLwfgvJCsNpU3WS0BcE6dlR1y7qI1IgAfIeGRq+X2VpuN49qDhM/VM g6Mt2n58EcpCglcN8STyo9sKPTnJaSxfHJm5ZZZ9o2kSJ+EfuP0B1mQOUeRVvmLxJjbM Tr0CsMn4NOBu60yQPDS5v32oAX9q3zHd5CFWJw2MMP5UQkY/z2drtS5SzripIFq+KmmX qr9QYDSCJlO2n6aAl442+zNsPKs3aAP738UgnpwP+nLDyZQbsabcjuMrekAM3JiU3rXC 4uFjoI5Rs6RsgbTjnskB8BEHiF69WjIhFpSK/mOwz6i2V0/9cN8k8EoRCMuQQ3NFMUtS Kkgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kcr9awMG6rk5zGzBMV6o9pl39zVUeKAy9YXOa3If7mQ=; b=alm6rZYgyGRlXBmxU+hFRG/Xl/5NadEtyAZh26zN9f3LlkX747eDc3mWrOlJLutdXH 25fZ+YOB1x2ZmVFYIYKLF7DSjKjA3JBPBncCZ0XAtDifV9B6Q4zoxl0P0EpAm7/wtYdO JOqV3DAsIXmqswqL2eJmCLZpXm1iePV3wuSgzG/X3fBZeVKWrw2Y+EIiy+e6acxcCFz1 IvtD6x4jUJ8h7Akqqgiq8D6m2Nt+/4b5RVITNdttYNu2K6XW+J/QyS2zyzqLQEFEt3zq qfanG5QFxs/6c6GK2wHdM6aHxe2ociTZPiq1RRmvf2SsKdwiS+GBkLWMEF+5MAy63pPr 1sGw== X-Gm-Message-State: APf1xPAPiH9DNGoooEB0m6M9YHXEtw1M2AfQxuoHb4QDipuk5EFCvO7S 46hn0sDaCywzVg1Y2j90+C8= X-Google-Smtp-Source: AH8x224rK/GjINqOiim0+b9isuWlUA2rexLroj4NiUT+BgP8bT75Cx1fsTiA9/0KYQdaliurVi0iLA== X-Received: by 10.99.119.72 with SMTP id s69mr776560pgc.224.1518521982434; Tue, 13 Feb 2018 03:39:42 -0800 (PST) Received: from roblaptop (d49-188-34-171.sun1.vic.optusnet.com.au. [49.188.34.171]) by smtp.gmail.com with ESMTPSA id c19sm36344075pfk.22.2018.02.13.03.39.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2018 03:39:41 -0800 (PST) Message-ID: <1518521976.11296.1.camel@gmail.com> Subject: Re: Require assistance in Postgres + Hibernate : Error: java.math.BigInteger cannot be cast to java.math.BigDecimal From: rob stone To: Vinodh NV , pgsql-general Date: Tue, 13 Feb 2018 22:39:36 +1100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Tue, 2018-02-13 at 14:28 +0530, Vinodh NV wrote: > Hi, > > Require assistance on the below: > > Code snippet: > Map 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