From d1d8d3205aabb8195040ec0c40c7f75e8b312b3e Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 16 Feb 2022 12:08:06 +0100 Subject: [PATCH] [jOOQ/jOOQ#13069] Add internal API to OSS edition It is much easier to manage code generation tests and examples if the internal API is available also to the OSS edition, preventing compilation errors when porting commercially generated code to the OSS edition. --- .../main/java/org/jooq/impl/TableImpl.java | 54 ++++++++++++------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/TableImpl.java b/jOOQ/src/main/java/org/jooq/impl/TableImpl.java index 49236d9364..6ead9964a5 100644 --- a/jOOQ/src/main/java/org/jooq/impl/TableImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/TableImpl.java @@ -68,6 +68,7 @@ import static org.jooq.impl.Keywords.K_TABLE; import static org.jooq.impl.Names.N_MULTISET; import static org.jooq.impl.QueryPartListView.wrap; import static org.jooq.impl.SchemaImpl.DEFAULT_SCHEMA; +import static org.jooq.impl.Tools.CONFIG; import static org.jooq.impl.Tools.EMPTY_OBJECT; import static org.jooq.impl.Tools.getMappedTable; import static org.jooq.tools.StringUtils.defaultIfNull; @@ -100,10 +101,13 @@ import org.jooq.TableField; import org.jooq.TableLike; import org.jooq.TableOptions; // ... +import org.jooq.exception.DataAccessException; import org.jooq.impl.QOM.UEmptyField; import org.jooq.impl.QOM.UNotYetImplemented; import org.jooq.tools.StringUtils; +import org.jetbrains.annotations.NotNull; + /** * A common base type for tables *

@@ -269,6 +273,17 @@ implements return null; } + /** + * Create a MULTISET one-to-many child table expression from + * this table. + */ + @org.jooq.Internal + @NotNull + protected Field> oneToManyMultiset( + ForeignKey path, + Function, ? extends TableLike> f + ) { + if (CONFIG.commercial()) { @@ -286,6 +301,23 @@ implements + } + + throw new DataAccessException("The one-to-many MULTISET convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); + } + + /** + * Create a MULTISET many-to-many child table expression from + * this table. + */ + @org.jooq.Internal + @NotNull + protected Field> manyToManyMultiset( + ForeignKey path1, + ForeignKey path2, + Function, ? extends TableLike> f + ) { + if (CONFIG.commercial()) { @@ -303,26 +335,10 @@ implements + } - - - - - - - - - - - - - - - - - - - + throw new DataAccessException("The many-to-many MULTISET convenience feature is available in the commercial jOOQ distribution only. Please consider upgrading to the jOOQ Professional Edition or jOOQ Enterprise Edition."); + }