Hi I use postgres in production environment, when using MappingTool to generate DDL, I found openjpa map BigDecimal to NUMERIC but ignored precision and scale specified in @Column. When use openjpa with mysql. It can generate NUMERIC(precision, scale). Finally I found because DBDictionary added NUMERIC into fixedSizeTypeNameSet. So postgres not generate (precision, scale). MySQLDictionary and SybaseDictionary removed NUMERIC from fixedSizeTypeNameSet and these two database support (precision, scale).
I haven't view all Dictionary class. Is there any reason to ignore (precision, scale) of numeric on postgres? I known the postgres database support NUMERIC(precision, scale) data type. When use openjpa with DB2 and Derby. It use DOUBLE for BigDecimal, Because numericTypeName defined to DOUBLE in AbstractDB2Dictionary. <https://issues.apache.org/jira/browse/OPENJPA-1224> tried to fix it, but finally backed out changes because a test regression. DOUBLE cannot represent decimal fractions exactly. Maybe we should consider to change it to NUMERIC. Regards, YaoCL