Hello Sergey, > The idea was to separate introspection phase and code generation phase in > jooq-maven-plugin. > It may be useful, if you do not want keep generated code on source control > (like in jooq-meta) > and do not want access database connection during build process. > > In introspection phase (for example, using development profile) > jooq-maven-plugin generates xml file, that contains database metadata. > You can keep in this file on source controlĀ (for example, in src/main/jooq) > and manually change it. > Code generation phase uses it as model and generates code (into > target/generated-sources/jooq).
To be clear about separation of concerns: The jooq-maven-plugin just accesses jooq-codegen / jooq-meta. It has no functionality of its own. I like your idea of having this intermediate step. In principle, once we have XML as a schema definition for jOOQ-relevant artefacts, the source code generator could actually just be a simple set of XSLT stylesheets. That would allow for much more flexibility, as users could override naming schemes when generating Java classes from XML. This would immediately resolve some open feature requests about being able to have user-defined prefixes / suffixes in generated tables. I might actually consider a cooperation with SchemaSpy or SchemaCrawler for that sake. SchemaSpy supports a large variety of databases and has a neat XML representation for your database schema: http://schemaspy.sourceforge.net/sample/library.xml But I'm not sure if they will correctly support UDT's and UDF's. Unfortunately, the JDBC API for database meta data navigation is not very reliable... See also my blog post about schema navigation: http://lukaseder.wordpress.com/2011/09/11/database-schema-navigation-in-java-2/ Cheers Lukas
