diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/spi/CriteriaQueryTupleTransformer.java b/hibernate-core/src/main/java/org/hibernate/jpa/spi/CriteriaQueryTupleTransformer.java index 41c3f1d9de5b..2b9841f69e2d 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/spi/CriteriaQueryTupleTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/spi/CriteriaQueryTupleTransformer.java @@ -46,7 +46,7 @@ public Object transformTuple(Object[] tuple, String[] aliases) { return tupleElements == null ? valueHandlerResult.length == 1 ? valueHandlerResult[0] : valueHandlerResult - : new TupleImpl( tuple ); + : new TupleImpl( valueHandlerResult ); } diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/CompoundSelectionImpl.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/CompoundSelectionImpl.java index 27bc0f44bad6..8a46206fa5fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/CompoundSelectionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/CompoundSelectionImpl.java @@ -63,7 +63,7 @@ public List getValueHandlers() { valueHandlers.add( valueHandler ); foundHandlers = foundHandlers || valueHandler != null; } - return foundHandlers ? null : valueHandlers; + return foundHandlers ? valueHandlers : null; } public void registerParameters(ParameterRegistry registry) {