|
11 | 11 | import java.util.List;
|
12 | 12 | import java.util.Map;
|
13 | 13 |
|
| 14 | +import jakarta.persistence.metamodel.Bindable; |
14 | 15 | import org.hibernate.Incubating;
|
15 | 16 | import org.hibernate.internal.util.collections.CollectionHelper;
|
16 | 17 | import org.hibernate.metamodel.UnsupportedMappingException;
|
|
31 | 32 | import org.hibernate.query.sqm.tree.select.SqmSubQuery;
|
32 | 33 | import org.hibernate.sql.ast.spi.FromClauseAccess;
|
33 | 34 | import org.hibernate.sql.ast.spi.SqlSelection;
|
| 35 | +import org.hibernate.type.BasicType; |
34 | 36 | import org.hibernate.type.descriptor.java.JavaType;
|
35 | 37 | import org.hibernate.type.descriptor.java.ObjectArrayJavaType;
|
36 | 38 |
|
@@ -177,20 +179,21 @@ public SqmPathSource<?> findSubPathSource(String name) {
|
177 | 179 | final SqmSelectableNode<?> component = components[index];
|
178 | 180 | if ( component instanceof SqmPath<?> ) {
|
179 | 181 | final SqmPath<?> sqmPath = (SqmPath<?>) component;
|
180 |
| - if ( sqmPath.getNodeType() instanceof SingularPersistentAttribute<?, ?> ) { |
| 182 | + final Bindable<?> model = sqmPath.getModel(); |
| 183 | + if ( model instanceof SingularPersistentAttribute<?, ?> ) { |
181 | 184 | //noinspection unchecked,rawtypes
|
182 | 185 | return new AnonymousTupleSqmAssociationPathSource(
|
183 | 186 | name,
|
184 | 187 | sqmPath,
|
185 |
| - ( (SingularPersistentAttribute<?, ?>) sqmPath.getNodeType() ).getType() |
| 188 | + ( (SingularPersistentAttribute<?, ?>) model ).getType() |
186 | 189 | );
|
187 | 190 | }
|
188 |
| - else if ( sqmPath.getNodeType() instanceof PluralPersistentAttribute<?, ?, ?> ) { |
| 191 | + else if ( model instanceof PluralPersistentAttribute<?, ?, ?> ) { |
189 | 192 | //noinspection unchecked,rawtypes
|
190 | 193 | return new AnonymousTupleSqmAssociationPathSource(
|
191 | 194 | name,
|
192 | 195 | sqmPath,
|
193 |
| - ( (PluralPersistentAttribute<?, ?, ?>) sqmPath.getNodeType() ).getElementType() |
| 196 | + ( (PluralPersistentAttribute<?, ?, ?>) model ).getElementType() |
194 | 197 | );
|
195 | 198 | }
|
196 | 199 | else if ( sqmPath.getNodeType() instanceof EntityDomainType<?> ) {
|
|
0 commit comments