Hello community, I've heard several voices calling for a type-mapping configuration at code-generation time in jOOQ. jOOQ's automatic type-mapping is not always what you may need, so I can see that this will be very helpful for the power users among you. Here are a couple of feature elements that I can see:
- General type rewrite, e.g. map all Oracle DATE columns to TIMESTAMP (to circumvent backwards-compatibility issues with Oracle databases) - General type activation / deactivation. In jOOQ 2.0 I'll add support for UNSIGNED INTEGER types. These are supported by some databases and may cause trouble in Java. But maybe you don't want unsigned types, so you can deactivate them - Specific type rewrites, maybe you want some Oracle columns to be treated as BOOLEAN, which Oracle doesn't support. These rewrites would be based on regular expressions (like today's includes/excludes lists). For example: # -------------------------------------------------------------- # This matches all columns in all tables with column names ending with # typical english suffixes for boolean names: ed (like closed, opened, deleted), # as well as some specific names. generator.generate.forced-type.BOOLEAN=MY_SCHEMA\.w+\.\w+(ED|ACTIVE|SENT) # This may be useful with stored procedures too, where Oracle only supports # plain NUMBER without precision or scale. In this case, all fields ending with ID generator.generate.forced-type.LONG=MY_SCHEMA\.PROC_\w+\.\w*ID # This will rewrite all DATE and TIME columns to TIMESTAMP generator.generate.overwrite-type.TIMESTAMP=DATE,TIME # -------------------------------------------------------------- I'm sure this will be useful to most of you. But maybe I'm still missing something? Another use case that will not yet be covered by the above functionality? Any feedback welcome Cheers Luaks
