I am wondering if anyone else has seen this behavior.  I am getting two 
different folder/package structures when using code generation.

This code:
schemaName = "JSL_DB"
pkgDirName = "src/main/java"
packageName = "jsl.utilities.jsldbsrc"

Connection connection = dataSource.getConnection();
org.jooq.util.jaxb.Configuration configuration = new 
org.jooq.util.jaxb.Configuration()
        .withGenerator(new Generator()
                .withDatabase(new org.jooq.util.jaxb.Database()
                        .withName("org.jooq.util.derby.DerbyDatabase")
                        .withInputSchema(schemaName))
                .withTarget(new Target()
                        .withPackageName(packageName)
                        .withDirectory(pkgDirName)));
GenerationTool tool = new GenerationTool();
tool.setConnection(connection);
tool.run(configuration);


Yields structure

jsl.utilities.jsldbsrc.tables (with records and table classes)

jsl.utilities.jsldbsrc.DefaultCatalog

jsl.utilities.jsldbsrc.JslDb

jsl.utilities.jsldbsrc.Keys

jsl.utilities.jsldbsrc.Tables


Versus,


org.jooq.util.jaxb.Configuration configuration = new 
org.jooq.util.jaxb.Configuration();
configuration.withGenerator(new Generator()
                .withDatabase(
                        new org.jooq.util.jaxb.Database()
                        .withName("org.jooq.util.ddl.DDLDatabase")
                        .withProperties(new Property()
                                        .withKey("scripts")
                                        
.withValue(pathToCreationScript.toString())))
                .withTarget(new 
Target().withPackageName(packageName).withDirectory(pkgDirName)));

GenerationTool tool = new GenerationTool();
tool.run(configuration);


Yields:

jsl.utilities.jsldbsrc.jsl_db 

jsl.utilities.jsldbsrc.jsl_db.tables (with records and table classes)

jsl.utilities.jsldbsrc.jsl_db.JslDb

jsl.utilities.jsldbsrc.jsl_db.Keys

jsl.utilities.jsldbsrc.jsl_db.Tables

jsl.utilities.jsldbsrc.jsl_db.Indexes

jsl.utilities.jsldbsrc.DefaultCatalog


The creation script to make the database in the first case is the same as the 
script used directly in

the second case.


I think that the expected behavior would be the same structure.  If the 
structure is different, it

breaks the imports that references the underlying classes.


The main difference is that in the first case the database was a live derby 
database and in the second 

case is org.jooq.util.ddl.DDLDatabase, which I believe is an in memory H2 
database.  


-- 
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