From 5201d762a6d68376182afb815a85dade22a06b0d Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 16 Jun 2023 16:34:17 +0200 Subject: [PATCH] [jOOQ/jOOQ#12456] Ambiguous match found when using aliases with implicit join and joining the same table twice --- jOOQ/src/main/java/org/jooq/impl/TableImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/TableImpl.java b/jOOQ/src/main/java/org/jooq/impl/TableImpl.java index e6602d2d0f..337ad38ef9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/TableImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/TableImpl.java @@ -212,12 +212,12 @@ implements * @deprecated - [#13639] [#14985] [#15005] - 3.19.0 - Please re-generate your code. */ @Deprecated - public TableImpl(Table path, ForeignKey childPath, Table parent) { - this(path, childPath, null, parent); + public TableImpl(Table path, ForeignKey childPath, Table aliased) { + this(path, childPath, null, aliased); } - public TableImpl(Table path, ForeignKey childPath, InverseForeignKey parentPath, Table parent) { - this(createPathAlias(path, childPath, parentPath), null, path, childPath, parentPath, parent, null, parent.getCommentPart()); + public TableImpl(Table path, ForeignKey childPath, InverseForeignKey parentPath, Table aliased) { + this(createPathAlias(path, childPath, parentPath), null, path, childPath, parentPath, aliased, null, aliased.getCommentPart()); } /** @@ -287,8 +287,8 @@ implements } else if (aliased instanceof TableImpl t) { this.path = t.path; - this.childPath = t.childPath; - this.parentPath = t.parentPath; + this.childPath = t.childPath == null ? null : Tools.aliasedKey(t.childPath, t.path, this); + this.parentPath = t.parentPath == null ? null : Tools.aliasedKey(t.parentPath.getForeignKey(), this, t.path).getInverseKey(); } else { this.path = null;