[odb-users] PostgreSQL NUMERIC(dec,prec)

Sean Clarke sean.clarke at sec-consulting.co.uk
Sun Aug 3 13:32:12 EDT 2014


Hi,
    just playing with ODB and so far I have been pretty impressed at the
ease of use and performance. I am just prototyping part of an existing
Java/Hibernate app and have hit a problem with NUMERIC support (or lack of
it). I have seen some postings from late 2012 that suggest a collection of
custom classes/templates/traits - is this still the case? I am kind of
surprised there is not a built in conversion from NUMERIC(x,y) to double.

I have played with the the "#pragma db map type("regex") as("subst")
[to("subst")] [from("subst")]" substitution, but can't seem to get it to
work.

Any quick/simple pointers to get me moving in? I have created a temp column
and converted the NUMERIC to DOUBLE PRECISION in the Db and it works fine -
but not only are there a lot of NUMERIC columns across a great many tables,
but I kind of liked the DB storing financial info in fixed format.

Regards
Sean


More information about the odb-users mailing list