I have a table with a field name “BID” with its data type set as NUMERIC(20,0). Now i know that it will never be a decimal/float value but always be a int/long i.e a natural number.
Is there a way for the code generator to make the variable inside the generated model class a Long as opposed to java.math.BigDecimal which it makes currently. Can it be set in jooq.properties??
This “feature” is currently only available for the Oracle database, where
NUMBERis the only numeric type available. Using Oracle with jOOQ,NUMBER(20, 0)would map tojava.math.BigIntegerinstead ofjava.math.BigDecimal.This behaviour will also be available for other RDBMS in the next release 1.6.3. See
https://sourceforge.net/apps/trac/jooq/ticket/639
Besides that, overriding of data type mappings in the code generator is currently not possible, but you could use
BIGINTas suggested by gbn, if you don’t really need 20 decimal digits.BIGINTcan hold most 19-digit decimals…