<generator>
<strategy>
<name>MyGeneratorStrategy</name>
</strategy>
...
<generator>
The names of the generated catalog and schema classes are now identical for SQL Server and MySQL (e. g. DefaultCatalog and DefaultSchema respectively).
But the generated catalog class contains the output catalog name (defined by the <outputCatalog> element) in its private constructor and the generated schema class contains the output schema name (defined by the <outputSchema> element) in its private constructor, respectively.
So how can I create a private constructor that do not use a string literal but rather a map of properties (a static map that is filled at application start time)?
Kind regards,
Marcus
The solution I come up with is to omit the schema and catalog notion during SQL generation:
DSL.using(<data source>, <dialect>, new Settings().withRenderSchema(false).withRenderCatalog(false)
The solution I come up with is to omit the schema and catalog notion during SQL generation:
DSL.using(<data source>, <dialect>, new Settings().withRenderSchema(false).withRenderCatalog(false)
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
For MySQL I use this configuration:
<database>
<name>org.jooq.util.mysql.MySQLDatabase</name>
<inputCatalog>my_database</inputCatalog>
<inputSchema>my_database</inputSchema>
<outputCatalogToDefault>true</outputCatalogToDefault>
<outputSchemaToDefault>true</outputSchemaToDefault>
<includes>.*</includes>
<excludes>schema_version_.*</excludes>
</database>
The desired result will be generated only, if I use the elements "inputSchema" and "outputSchemaToDefault". Now the two classes "DefaultCatalog" and "DefaultSchema" are generated using an empty string for the catalog / schema name in the constructor.
<generate>
<deprecated>false</deprecated>
<fluentSetters>true</fluentSetters>
<globalCatalogReferences>false</globalCatalogReferences>
<globalRoutineReferences>true</globalRoutineReferences>
<globalSchemaReferences>false</globalSchemaReferences>
<globalTableReferences>true</globalTableReferences>
<pojos>true</pojos>
<records>true</records>
<relations>true</relations>
</generate>
So in the end I was not able to find exaclty one combination of elements "inputCatalog", "inputSchema", "outputCatalogToDefault", "outputSchemaToDefault" that work for both DBMS types. Hence I was forced to use the solution of my previous post.