Hi Manuel

In the second case, you omitted the inputSchema flag, which means that all
schemas are being generated. If there is more than one inputSchema, the
schema name is part of the package structure, and you're also getting the
DefaultCatalog, which is now the top level object referencing all contained
schemas.

I hope this helps,
Lukas

Am Sa., 30. Juni 2018 um 01:41 Uhr schrieb Manuel Rossetti <
[email protected]>:

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

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