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
generate() {
pojos true
daos true
}
generate() {
pojos(true)
daos(true)
}
--
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Lukas,
after some googleling i've found this on stackoverflow
http://stackoverflow.com/questions/11388838/groovy-markupbuilder-name-conflict/11389034#11389034
if i change the groovy code to...
generate([:]) {
pojos true
daos true
}
... the created XML is correct and pojos were created. I don't know what's going on behind the scenes. But it works for me now.
Cheers
Sascha