From 2eed461b9e26e3fd47bc32f78e6f49565edd640c Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Thu, 11 May 2023 10:26:07 +0200 Subject: [PATCH] HHH-16555 Correct source alias for embedded virtual table group joins on implicitly treated paths --- .../sql/ast/tree/from/StandardVirtualTableGroup.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/StandardVirtualTableGroup.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/StandardVirtualTableGroup.java index 9e5fb00f0b..3d6a2f5cc1 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/StandardVirtualTableGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/StandardVirtualTableGroup.java @@ -16,6 +16,8 @@ import org.hibernate.metamodel.mapping.OwnedValuedModelPart; import org.hibernate.metamodel.mapping.ValuedModelPart; import org.hibernate.spi.NavigablePath; +import static org.hibernate.internal.util.NullnessUtil.castNonNull; + /** * @author Christian Beikov */ @@ -32,7 +34,7 @@ public class StandardVirtualTableGroup extends AbstractTableGroup implements Vir underlyingTableGroup.canUseInnerJoins(), navigablePath, modelPart, - underlyingTableGroup.getSourceAlias(), + castNonNull( navigablePath.getRealParent() ).getAlias(), null, null );