diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractSelectionQuery.java b/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractSelectionQuery.java index 9953a29bc3..6d717ad8b1 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractSelectionQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractSelectionQuery.java @@ -315,7 +315,7 @@ public abstract class AbstractSelectionQuery } if ( !sessionFactory.getSessionFactoryOptions().getJpaCompliance().isJpaQueryComplianceEnabled() ) { - verifyResultType( expectedResultClass, sqmSelection.getNodeType() ); + verifyResultType( expectedResultClass, sqmSelection.getExpressible() ); } } // else, let's assume we can instantiate it! diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBasicValuedSimplePath.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBasicValuedSimplePath.java index 5e07bb77fd..deb419c6b8 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBasicValuedSimplePath.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmBasicValuedSimplePath.java @@ -122,7 +122,7 @@ public class SqmBasicValuedSimplePath @Override public JavaType getExpressibleJavaType() { - return getJavaTypeDescriptor(); + return super.getExpressible().getExpressibleJavaType(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmEmbeddedValuedSimplePath.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmEmbeddedValuedSimplePath.java index cce753c1ce..1a6c7d5340 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmEmbeddedValuedSimplePath.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/domain/SqmEmbeddedValuedSimplePath.java @@ -109,7 +109,7 @@ public class SqmEmbeddedValuedSimplePath @Override public JavaType getExpressibleJavaType() { - return getJavaTypeDescriptor(); + return super.getExpressible().getExpressibleJavaType(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmAliasedNode.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmAliasedNode.java index 5ec4a50cca..e164b3c535 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmAliasedNode.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmAliasedNode.java @@ -30,4 +30,9 @@ public interface SqmAliasedNode extends SqmTypedNode { default SqmExpressible getNodeType() { return getSelectableNode().getNodeType(); } + + @Override + default SqmExpressible getExpressible() { + return getSelectableNode().getExpressible(); + } }