Re: PostgreSQL Money type

From: Michael Gentry (blacknex..mail.com)
Date: Tue Oct 09 2007 - 15:25:15 EDT

  • Next message: Chris Gamache: "Re: PostgreSQL Money type"

    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 <cgamach..mail.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
    >



    This archive was generated by hypermail 2.0.0 : Tue Oct 09 2007 - 15:25:51 EDT