I ran into this with 3.11.11 generator.
The fix is to specify the input catalog.
generator() {
database() {
name 'org.jooq.meta.sqlserver.SQLServerDatabase'
overridePrimaryKeys 'id'
inputCatalog 'S2_JOOQ_ADS'
outputCatalogToDefault true
schemata(){
schema(){
inputSchema('dbo')
}......
On Monday, August 20, 2018 at 5:44:08 PM UTC-5, [email protected]
wrote:
>
>
> Hi,
>
> I am working with the 3.11.4 trial version. All files are generated
> correctly except DefaultCatalog.java. The DefaultCatalog.java is generated
> with multiple duplicate entries for the inputSchema.
>
> Removing the duplicate in DefaultCatalog.java manually results in
> successful compilation of all generated java files. But every time I
> re-run the codegen task they re-appear.
>
> Any help or advice is most appreciated.
>
>
>
> *GRADLE CONFIG*
>
> =================================================================================================
>
> buildscript {
>
> ext {
> springBootVersion = '2.0.4.RELEASE'
> }
> repositories {
>
> flatDir dirs: ["$projectDir/libs/JOOQ/3.11.4/JOOQ-lib"]
> jcenter()
> }
> dependencies {
>
> classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}",
> "nu.studer:gradle-jooq-plugin:3.0.1",
> "com.microsoft.sqlserver:mssql-jdbc:6.2.2.jre8",
> "org.flywaydb:flyway-gradle-plugin:4.1.1"
> )
>
> classpath fileTree(dir: '$projectDir/libs/JOOQ/3.11.4/JOOQ-lib', include:
> '*.jar', exclude: 'jooq-scala-*.jar')
> }
> }
>
> apply plugin: 'java'
> apply plugin: 'idea'
> apply plugin: 'org.springframework.boot'
> apply plugin: 'io.spring.dependency-management'
> apply plugin: 'org.flywaydb.flyway'
>
> group = 'com.thirdpoint.server'
> version = '0.0.1-SNAPSHOT'
> sourceCompatibility = 1.8
>
> repositories {
>
> flatDir dirs: ["$projectDir/libs/JOOQ/3.11.4/JOOQ-lib"]
> jcenter()
> }
>
> ext {
> springCloudVersion = 'Finchley.SR1'
> }
>
> ext['jooq.version'] = '3.11.4'
>
> dependencies {
>
> compile name: 'jooq-3.11.4'
> compile('org.springframework.boot:spring-boot-starter-actuator')
> compile('org.springframework.boot:spring-boot-starter-websocket')
> compile('org.springframework.cloud:spring-cloud-starter-aws')
> compile('org.springframework.cloud:spring-cloud-stream')
> compile('org.springframework.cloud:spring-cloud-stream-binder-kafka')
> compile('org.springframework.kafka:spring-kafka')
> compile('org.flywaydb:flyway-core:3.2.1')
>
> testCompile('org.springframework.boot:spring-boot-starter-test')
> testCompile('org.springframework.cloud:spring-cloud-stream-test-support')
> }
>
> dependencyManagement {
> imports {
> mavenBom
> "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
> }
> }
>
> task generateAccounting {
> doLast {
>
> def writer = new StringWriter()
> def xml = new groovy.xml.MarkupBuilder(writer)
> .configuration('xmlns': 'http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd')
> {
> jdbc() {
> driver('com.microsoft.sqlserver.jdbc.SQLServerDriver')
> url('jdbc:sqlserver://XXXX;integratedSecurity=true;databaseName=XXXX')
> }
> generator() {
> database {
> inputSchema 'stage'
> }
>
> generate([:]) {
> pojos true
> daos true
> }
> target() {
> packageName('com.thirdpoint.server.model.generated.accounting')
> directory('src/main/java/')
> }
> }
> }
>
> org.jooq.codegen.GenerationTool.generate(
> javax.xml.bind.JAXB.unmarshal(new StringReader(writer.toString()),
> org.jooq.meta.jaxb.Configuration.class)
> )
> }
> }
>
>
> task generateAll {
> dependsOn generateAccounting
> }
>
>
>
>
> *GENERATED DefaultCatalog.java*
>
> =======================================================================================================================================
>
> /*
> * This file is generated by jOOQ.
> */
> package com.thirdpoint.server.model.generated.accounting;
>
>
> import com.thirdpoint.server.model.generated.accounting.stage.Stage;
>
> import java.util.ArrayList;
> import java.util.Arrays;
> import java.util.List;
>
> import javax.annotation.Generated;
>
> import org.jooq.Schema;
> import org.jooq.impl.CatalogImpl;
>
>
> /**
> * This class is generated by jOOQ.
> */
> @Generated(
> value = {
> "http://www.jooq.org",
> "jOOQ version:3.11.2"
> },
> comments = "This class is generated by jOOQ"
> )
> @SuppressWarnings({ "all", "unchecked", "rawtypes" })
> public class DefaultCatalog extends CatalogImpl {
>
> private static final long serialVersionUID = 21313; // replaced when
> posting on JOOQ
>
> /**
> * The reference instance of <code></code>
> */
> public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog();
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * The schema <code>stage</code>.
> */
> public final Stage STAGE =
> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE;
>
> /**
> * No further instances allowed
> */
> private DefaultCatalog() {
> super("");
> }
>
> @Override
> public final List<Schema> getSchemas() {
> List result = new ArrayList();
> result.addAll(getSchemas0());
> return result;
> }
>
> private final List<Schema> getSchemas0() {
> return Arrays.<Schema>asList(
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE,
> Stage.STAGE);
> }
> }
>
>
>
>
>
>
>
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/b71e11b8-267a-4983-b01e-1ad2fed50f60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.