This issue was recently encountered on Stack Overflow: http://stackoverflow.com/q/14123209/521799
You can force a set of fields matched by a regex (not a data type, such as NUMBER(1, 0)) to the SQL BOOLEAN data type. This will then work for both H2 and Oracle Cheers Lukas 2013/1/28 Witold Szczerba <[email protected]> > Hi, > I am using code generator and without applying my converter the generated > code looks like this: > (class names simplified) > > public class Estate extends UpdatableTableImpl<EstateRecord> { > [...] > public final TableField<EstateRecord, Byte> DEVELOPED = > createField("DEVELOPED", SQLDataType.TINYINT, this); > > //with converter applied: > > public final TableField<EstateRecord, Boolean> DEVELOPED = > createField("DEVELOPED", SQLDataType.TINYINT.asConvertedDataType(new > OracleBooleanConverter()), this); > [...] > } > > I do believe it could handle boolean type conversion on the fly (in Oracle > the column type is NUMBER(1,0), but my case is about code generator. > > Regards, > Witold Szczerba > > > On 28 January 2013 13:13, Ben Hood <[email protected]> wrote: > >> Hey Witold, >> >> JOOQ _should_ handle this seamlessly - our app runs on H2 and Oracle >> without the need to do any custom conversion. AFAIK, the JOOQ factory reads >> the dialect at runtime and issues the appropriate SQL transparently, as >> long as your boolean encoding is vaguely sane (e.g. something like 1,0, >> true, false). Have you been seeing issues with this? >> >> Cheers, >> >> Ben >> >> On Sunday, 27 January 2013 at 17:27, Witold Szczerba wrote: >> >> Hi, >> I am migrating from H2 to Oracle (H2 was used in early dev to kick start >> the project, customer forces us to use Oracle). There are few problems, one >> of which is the Oracle does not support boolean types, so following manual >> section: >> >> Custom data types and type conversion >> http://www.jooq.org/doc/2.6/manual/code-generation/custom-data-types/ >> >> Snippets available: https://gist.github.com/4649307 >> >> My question is: is it possible to enable that converter only when >> operating on Oracle and ignore it otherwise? >> >> Regards, >> Witold Szczerba >> >> -- >> >> >> >> >> -- >> >> >> > > -- > > > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
