Hello,

Thanks for reporting this. The underscore is indeed used to prevent
compilation errors, as we do need some legal token for package names. The
reason why it appears at all is the fact that you're using multiple input
schemata, where each schema is generated in its own package. We simply
haven't thought of combining that with the <outputSchemaToDefault/> feature
yet. I've registered an issue to track this:
https://github.com/jOOQ/jOOQ/issues/4168

Probably, in a future version of jOOQ, we'll implement this:
https://github.com/jOOQ/jOOQ/issues/3960

... where the schema name is always generated as a package name, regardless
of the number of input schemata. In that case, fixing #4168 will make more
sense where the absence of a schema name in the package name will indicate
"default" schema (or no schema in databases like SQLite)

In any case, thank you very much for pointing this out to us.

Cheers
Lukas

2015-03-30 21:42 GMT+02:00 ud3sh <[email protected]>:

> I believe I've run into a bug in the Jooq Maven plugin (jooq-codegen-
> maven).  It seems to me that outputSchemaToDefault flag is not
> interpreted correctly during code generation when it is triggered via the
> maven plugin. I am running 3.5.3 of the jooq maven codegen plugin as well
> as jooq itself.
>
> The code generation snippet in the pom file looks something like this.
>                     <generator>
>                         <name>org.jooq.util.DefaultGenerator</name>
>                         <database>
>                             <name>org.jooq.util.derby.DerbyDatabase</name>
>                             <includes>.*</includes>
>                             <schemata>
>                                 <schema>
>                                     <inputSchema>public</inputSchema>
> *
>   <outputSchemaToDefault>true</outputSchemaToDefault>*
>                                 </schema>
>                                 <schema>
>                                     <inputSchema>analytics</inputSchema>
>                                     <outputSchema>analytics</outputSchema>
>                                 </schema>
>                             </schemata>
>                         </database>
>                         <target>
>                             <packageName>com.foo.model</packageName>
>
> <directory>target/generated-sources/jooq</directory>
>                         </target>
>                     </generator>
> I expect code generated for the public schema to be in package
> *com.foo.model*.
> Instead they end up being in *com.foo.model._*
> It seems to be that the maven plugin interprets this the output schema to
> be blank and appends an underscore because it is an invalid package name.
> This looks like a bug to me, unless there is a user error on my end.
>
> --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to