From f14fdafef8f81dfb056f82054dfe4df7316932e0 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 9 Jul 2021 10:06:50 +0200 Subject: [PATCH] [jOOQ/jOOQ#12118] Regression in SQLite code generation for unnamed composite pkeys on JDK 9+ with the jOOQ Open Source Edition --- .../java/org/jooq/codegen/DefaultGeneratorStrategy.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jOOQ-codegen/src/main/java/org/jooq/codegen/DefaultGeneratorStrategy.java b/jOOQ-codegen/src/main/java/org/jooq/codegen/DefaultGeneratorStrategy.java index c868366029..460d50fe9c 100644 --- a/jOOQ-codegen/src/main/java/org/jooq/codegen/DefaultGeneratorStrategy.java +++ b/jOOQ-codegen/src/main/java/org/jooq/codegen/DefaultGeneratorStrategy.java @@ -182,11 +182,9 @@ public class DefaultGeneratorStrategy extends AbstractGeneratorStrategy { else if (definition instanceof IndexDefinition && asList(MARIADB, MYSQL).contains(definition.getDatabase().getDialect().family())) return ((IndexDefinition) definition).getTable().getOutputName().toUpperCase(targetLocale) + "_" + definition.getOutputName().toUpperCase(targetLocale); - - - - - + // [#5538] [#11286] [#12118] The same is true for unique keys, which are really indexes + else if (definition instanceof UniqueKeyDefinition && asList(SQLITE).contains(definition.getDatabase().getDialect().family())) + return ((UniqueKeyDefinition) definition).getTable().getOutputName().toUpperCase(targetLocale) + "__" + definition.getOutputName().toUpperCase(targetLocale); // [#9758] And then also for foreign keys else if (definition instanceof ForeignKeyDefinition && asList(POSTGRES, SQLITE).contains(definition.getDatabase().getDialect().family()))