cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: PostgreSQL Money type
Date Tue, 09 Oct 2007 19:25:15 GMT
In the modeler, for the DbEntity, try using the NUMERIC (or maybe even
DECIMAL, but try NUMERIC first) type and for the ObjEntity it should
sync up as a java.math.BigDecimal.  Set the scale to 2 (if you want 2
places after the decimal point).

I believe that will work, but I don't have PostgreSQL here to test it
quickly.  Also, according to the PostgreSQL documentation, the money
type is deprecated:

http://www.postgresql.org/docs/8.2/interactive/datatype-money.html

It is essentially a NUMERIC with a default scale of 2.

/dev/mrg



On 10/9/07, Chris Gamache <cgamache@gmail.com> wrote:
> Fellow Cayenne users,
>
> How do you handle inserting data into columns of type Money?
>
> Is there a magic combination of Java type and SQL type?
>
> Have you created a Money class and a custom data type converter?
>
> CG
>

Mime
View raw message