Skip to content

Commit dfe9bd4

Browse files
mbelladebeikov
authored andcommitted
HHH-19905 Re-use existing implicit joins regardless of type
1 parent d38fdd4 commit dfe9bd4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hibernate-core/src/main/java/org/hibernate/query/hql/internal/QualifiedJoinPathConsumer.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,11 @@ private AttributeJoinDelegate resolveAlias(String identifier, boolean isTerminal
203203
if ( allowReuse ) {
204204
if ( !isTerminal ) {
205205
for ( SqmJoin<?, ?> sqmJoin : lhs.getSqmJoins() ) {
206-
// In order for an HQL join to be reusable, is must have the same path source,
206+
// In order for an HQL join to be reusable, it must have the same path source,
207207
if ( sqmJoin.getModel() == subPathSource
208-
// must not have a join condition
209-
&& sqmJoin.getJoinPredicate() == null
210-
// and the same join type
211-
&& sqmJoin.getSqmJoinType() == joinType ) {
208+
// and must not have a join condition.
209+
&& sqmJoin.getJoinPredicate() == null ) {
210+
// We explicitly allow reusing implicit joins of any type
212211
return sqmJoin;
213212
}
214213
}

0 commit comments

Comments
 (0)