diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java index f949718192..f8b0b4bf2f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java @@ -389,7 +389,7 @@ public class H2Dialect extends Dialect { @Override public NullOrdering getNullOrdering() { - return NullOrdering.FIRST; + return NullOrdering.SMALLEST; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/CorrelatedTableGroup.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/CorrelatedTableGroup.java index eb7c0a500a..f70a21f45b 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/CorrelatedTableGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/from/CorrelatedTableGroup.java @@ -76,14 +76,14 @@ public class CorrelatedTableGroup extends AbstractTableGroup { String tableExpression, boolean allowFkOptimization, boolean resolve) { - final TableReference primaryTableReference = correlatedTableGroup.getPrimaryTableReference().getTableReference( + final TableReference tableReference = correlatedTableGroup.getTableReference( navigablePath, tableExpression, allowFkOptimization, resolve ); - if ( primaryTableReference != null ) { - return primaryTableReference; + if ( tableReference != null ) { + return tableReference; } for ( TableGroupJoin tableGroupJoin : getNestedTableGroupJoins() ) { final TableReference groupTableReference = tableGroupJoin.getJoinedGroup() @@ -101,17 +101,6 @@ public class CorrelatedTableGroup extends AbstractTableGroup { return groupTableReference; } } - for ( TableReferenceJoin tableReferenceJoin : correlatedTableGroup.getTableReferenceJoins() ) { - final TableReference tableReference = tableReferenceJoin.getJoinedTableReference().getTableReference( - navigablePath, - tableExpression, - allowFkOptimization, - resolve - ); - if ( tableReference != null ) { - return tableReference; - } - } return null; } diff --git a/hibernate-core/src/test/java/org/hibernate/query/criteria/internal/NullPrecedenceTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/internal/NullPrecedenceTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/query/criteria/internal/NullPrecedenceTest.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/internal/NullPrecedenceTest.java index 8e8d3c660a..f8fb5d89ec 100644 --- a/hibernate-core/src/test/java/org/hibernate/query/criteria/internal/NullPrecedenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/internal/NullPrecedenceTest.java @@ -1,4 +1,4 @@ -package org.hibernate.query.criteria.internal; +package org.hibernate.orm.test.query.criteria.internal; import java.util.List;