You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Jacek Laskowski <ja...@laskowski.net.pl> on 2007/04/20 10:32:26 UTC

BigDecimal, PostgreSQL 8.2 and @Column elements - precision and scale

Hi,

I'm getting an illegal SQL exception when working with OpenJPA
0.9.8-incubator-SNAPSHOT and PostgreSQL 8.2.3 with an persistent
attribute defined as follows:

    @Column(precision = 7, scale = 3)
    public BigDecimal getPensja() {
        return pensja;
    }

OpenJPA generates

  pensja DOUBLE PRECISION(7, 3)

for it that makes postgresql unhappy. When I leave DOUBLE PRECISION
alone, the sql statement works fine.

Should it map to DOUBLE PRECISION (inexact) or NUMERIC (exact)?

Where's the mapping done? What class controls how the final sql looks
like? Is this a bug I should report to the jira?

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl