HHH-18007 Use correct expressible when checking query result type

This commit is contained in:
Marco Belladelli 2024-05-02 09:52:43 +02:00 committed by Christian Beikov
parent e036509487
commit 758a660bca
4 changed files with 8 additions and 3 deletions

View File

@ -317,7 +317,7 @@ public abstract class AbstractSelectionQuery<R>
} }
if ( !sessionFactory.getSessionFactoryOptions().getJpaCompliance().isJpaQueryComplianceEnabled() ) { if ( !sessionFactory.getSessionFactoryOptions().getJpaCompliance().isJpaQueryComplianceEnabled() ) {
verifyResultType( expectedResultClass, sqmSelection.getNodeType() ); verifyResultType( expectedResultClass, sqmSelection.getExpressible() );
} }
} }
// else, let's assume we can instantiate it! // else, let's assume we can instantiate it!

View File

@ -175,7 +175,7 @@ public class SqmBasicValuedSimplePath<T>
@Override @Override
public JavaType<T> getExpressibleJavaType() { public JavaType<T> getExpressibleJavaType() {
return getJavaTypeDescriptor(); return super.getExpressible().getExpressibleJavaType();
} }
@Override @Override

View File

@ -109,7 +109,7 @@ public class SqmEmbeddedValuedSimplePath<T>
@Override @Override
public JavaType<T> getExpressibleJavaType() { public JavaType<T> getExpressibleJavaType() {
return getJavaTypeDescriptor(); return super.getExpressible().getExpressibleJavaType();
} }
@Override @Override

View File

@ -30,4 +30,9 @@ public interface SqmAliasedNode<T> extends SqmTypedNode<T> {
default SqmExpressible<T> getNodeType() { default SqmExpressible<T> getNodeType() {
return getSelectableNode().getNodeType(); return getSelectableNode().getNodeType();
} }
@Override
default SqmExpressible<T> getExpressible() {
return getSelectableNode().getExpressible();
}
} }