From 09bf6265e83797575bdf74faec7c8fa934b1ccc3 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 21 Sep 2022 17:34:09 +0200 Subject: [PATCH] [jOOQ/jOOQ#12022] Add code generator support for MySQL's invisible columns --- .../jooq/meta/mysql/MySQLTableDefinition.java | 4 + jOOQ/src/main/java/org/jooq/impl/Tools.java | 98 +++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLTableDefinition.java b/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLTableDefinition.java index 720c9cd798..6f9220a0a3 100644 --- a/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLTableDefinition.java +++ b/jOOQ-meta/src/main/java/org/jooq/meta/mysql/MySQLTableDefinition.java @@ -42,6 +42,7 @@ import static java.util.Arrays.asList; // ... import static org.jooq.impl.DSL.coalesce; import static org.jooq.impl.DSL.name; +import static org.jooq.impl.DSL.noCondition; import static org.jooq.meta.mysql.information_schema.Tables.COLUMNS; import java.sql.SQLException; @@ -109,6 +110,9 @@ public class MySQLTableDefinition extends AbstractTableDefinition { // [#5213] Duplicate schema value to work around MySQL issue https://bugs.mysql.com/bug.php?id=86022 .where(COLUMNS.TABLE_SCHEMA.in(getSchema().getName(), getSchema().getName())) .and(COLUMNS.TABLE_NAME.equal(getName())) + .and(getDatabase().getIncludeInvisibleColumns() + ? noCondition() + : COLUMNS.EXTRA.notLike("%INVISIBLE%")) .orderBy(COLUMNS.ORDINAL_POSITION) ) { diff --git a/jOOQ/src/main/java/org/jooq/impl/Tools.java b/jOOQ/src/main/java/org/jooq/impl/Tools.java index d994a2a69e..d9012e0b32 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Tools.java +++ b/jOOQ/src/main/java/org/jooq/impl/Tools.java @@ -1296,6 +1296,104 @@ final class Tools { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +