HHH-17135 Fix entity-typed null-literal

This commit is contained in:
Marco Belladelli 2023-09-01 11:24:23 +02:00 committed by Christian Beikov
parent ae33808f71
commit 8155b6bcda
1 changed files with 4 additions and 0 deletions

View File

@ -5298,6 +5298,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
if ( mappingModelExpressible instanceof BasicValuedMapping ) {
return new QueryLiteral<>( null, (BasicValuedMapping) mappingModelExpressible );
}
else if ( mappingModelExpressible instanceof EntityMappingType ) {
// When selecting a literal null entity type, we should simply return a single null object
mappingModelExpressible = null;
}
final MappingModelExpressible<?> keyExpressible = getKeyExpressible( mappingModelExpressible );
if ( keyExpressible == null ) {
// treat Void as the bottom type, the class of null