diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java index 5758e526d6..51c3659d2b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java @@ -6503,10 +6503,7 @@ public abstract class BaseSqmToSqlAstConverter extends Base boolean hasAnyTreatUsage = false; for ( SqmPredicate subPredicate : predicate.getPredicates() ) { disjunction.add( (Predicate) subPredicate.accept( this ) ); - if ( conjunctTreatUsages.isEmpty() ) { - conjunctTreatUsagesList.add( null ); - } - else { + if ( !conjunctTreatUsages.isEmpty() ) { hasAnyTreatUsage = true; for ( Map.Entry, Set> entry : conjunctTreatUsages.entrySet() ) { conjunctTreatUsagesUnion.computeIfAbsent( entry.getKey(), k -> new HashSet<>() )