Hello Ravi,
> 1. The example for <forcedType> parameter uses column names to do the
> mapping. Is there a way to indicate that a data type (e.g CHAR(1)) should be
> mapped to a Boolean?
This is possible with some experimental code generation functionality.
It is not yet documented, however. You can use <forcedType/> to force
a SQL data type upon a set of columns. The following example is from
the jOOQ integration tests::
<forcedType>
<!-- Use a valid Postgres SQL type here, when generating from Postgres -->
<name>BOOLEAN</name>
<!-- All objects matching this regular expression will be forced
to type BOOLEAN -->
<expressions>(?i:(.*?.)?T_BOOLEANS.(VC|C|N)_BOOLEAN)</expressions>
</forcedType>
> 2. Can I specify custom data mapping using the ANT task or can I invoke the
> ANT task with a jooq-config.xml file?
The org.jooq.util.GenerationTask ant task is not up to date with the
latest developments of jooq-codegen. I recommend running the
GenerationTool using ant's <java/> task, as documented here:
http://www.jooq.org/manual/META/Configuration/
> 3. Is it possible to not specify the schema name at all? I tried the
> following with Postgres and it worked. Haven't tried it with SQL
> Server/Oracle yet.
>
> new Factory(connection, dialect,
> new Settings().withRenderMapping(
> new RenderMapping().withDefaultSchema("")));
This would have no effect on generated SQL. What are you trying to do?
> 4. How do I set up JOOQ logging? e.g to see the SQL statements it is
> generating? We use log4j.
The default for Settings.isExecuteLogging() is true, so jOOQ already
logs all rendered SQL to log4j's debug log output. This is done using
the org.jooq.tools.LoggerListener, which supports log4j, slf4j, and
java.util.logging. If you need more information, you can set up your
own ExecuteListener, as documented here:
http://www.jooq.org/manual/ADVANCED/ExecuteListener/
A sample log4j configuration can be found here:
https://github.com/lukaseder/jOOQ/blob/master/jOOQ-test/src/log4j.xml
Hope this helps
Cheers
Lukas