Hi Sascha,
>From a high level, I'd say you're missing parentheses. You wrote:
generate() {
pojos true
daos true
}
I think it should be
generate() {
pojos(true)
daos(true)
}
But I'm rather inexperienced with Groovy's MarkupBuilder. Perhaps I'm
missing something else. You might get a better answer on Stack Overflow for
this...
Hope this helps,
Lukas
2015-12-05 12:04 GMT+01:00 Sascha Pfau <[email protected]>:
> Hello Lukas,
>
>
>
> i've some troubles with configuration generation for jooq codegen. The
> generation of daos and pojos should be enabled. So the XML should look like
> this:
>
>
>
> -- snip --
>
> </jdbc>
> <generator>
> <database>
> <includes>.*</includes>
> <inputSchema>XXX</inputSchema>
> </database>
>
> </generate>
> <pojos>true</pojos>
>
> <daos>true</daos>
> </generate>
>
> <target>
> -- snip --
>
>
>
> This is the builder i've used:
>
>
>
> def xml = new groovy.xml.MarkupBuilder(writer)
>
> .configuration('xmlns': 'http://www.jooq.org/xsd/jooq-codegen-3.7.0.xsd')
> {
>
> jdbc() {
>
> driver('com.mysql.jdbc.Driver')
>
> url('jdbc:mysql://server:3306/database')
>
> user('test')
>
> password('test')
>
> }
>
> generator() {
>
> name('org.jooq.util.DefaultGenerator')
>
> database() {
>
> name('org.jooq.util.mysql.MySQLDatabase')
>
> includes('.*')
>
> inputSchema('XXX')
>
> }
>
> generate() {
>
> pojos true
>
> daos true
>
> }
>
> target() {
>
> packageName('de.XXX')
>
> directory('src/db')
>
> }
>
> }
>
> }
>
>
>
> But the MarkupBuilder creates always the following wrong XML code
>
>
>
> <configuration xmlns='http://www.jooq.org/xsd/jooq-codegen-3.7.0.xsd'>
> <jdbc>
> <driver>com.mysql.jdbc.Driver</driver>
> <url>jdbc:mysql://server:3306/database</url>
> <user>test</user>
> <password>test</password>
> </jdbc>
> <generator>
> <database>
> <includes>.*</includes>
> <inputSchema>XXX</inputSchema>
> </database>
> <pojos>true</pojos>
>
> <daos>true</daos>
> <target>
> <packageName>de.XXX</packageName>
> <directory>src/db</directory>
> </target>
> </generator>
> </configuration>
>
>
>
> pojos and daos are not enclosed by generator tag and so the code
> generation ignore it and does not create any pojos or daos. Any hints
> what's wrong?
>
>
>
> Cheers
>
> MrPeacock
>
> --
> 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.