Skip to content

Commit

Permalink
HHH-18007 Use correct expressible when checking query result type
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel authored and beikov committed Jun 11, 2024
1 parent 433fbe9 commit 1919409
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ protected static <T> void checkQueryReturnType(
}

if ( !sessionFactory.getSessionFactoryOptions().getJpaCompliance().isJpaQueryComplianceEnabled() ) {
verifyResultType( expectedResultClass, sqmSelection.getNodeType() );
verifyResultType( expectedResultClass, sqmSelection.getExpressible() );
}
}
// else, let's assume we can instantiate it!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public Class<T> getJavaType() {

@Override
public JavaType<T> getExpressibleJavaType() {
return getJavaTypeDescriptor();
return super.getExpressible().getExpressibleJavaType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public <S extends T> SqmTreatedPath<T, S> treatAs(EntityDomainType<S> treatTarge

@Override
public JavaType<T> getExpressibleJavaType() {
return getJavaTypeDescriptor();
return super.getExpressible().getExpressibleJavaType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ public interface SqmAliasedNode<T> extends SqmTypedNode<T> {
default SqmExpressible<T> getNodeType() {
return getSelectableNode().getNodeType();
}

@Override
default SqmExpressible<T> getExpressible() {
return getSelectableNode().getExpressible();
}
}

0 comments on commit 1919409

Please sign in to comment.