From 122d1806c71dbd04af57ac6fb2644174597a6fd8 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Mon, 14 Oct 2024 17:00:17 +0200 Subject: [PATCH] HHH-18681 InterpretationException executing subquery in case-when : o.h.query.sqm.tree.select.SqmSelection.getExpressible() is null --- .../hibernate/query/hql/internal/SemanticQueryBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java index e735975fa7..f52904113f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java @@ -5259,9 +5259,11 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implem final List> selections = subQuery.getQuerySpec().getSelectClause().getSelections(); if ( selections.size() == 1 ) { - subQuery.applyInferableType( selections.get( 0 ).getExpressible().getSqmType() ); + final SqmExpressible expressible = selections.get( 0 ).getExpressible(); + if ( expressible != null ) { + subQuery.applyInferableType( expressible.getSqmType() ); + } } - return subQuery; } finally {