Skip to content

Commit 9f550bc

Browse files
mbelladebeikov
authored andcommitted
HHH-19905 Re-use existing implicit joins regardless of type
1 parent 82a33c8 commit 9f550bc

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
@@ -209,12 +209,11 @@ private AttributeJoinDelegate resolveAlias(String identifier, boolean isTerminal
209209
if ( allowReuse ) {
210210
if ( !isTerminal ) {
211211
for ( SqmJoin<?, ?> sqmJoin : lhs.getSqmJoins() ) {
212-
// In order for an HQL join to be reusable, is must have the same path source,
212+
// In order for an HQL join to be reusable, it must have the same path source,
213213
if ( sqmJoin.getModel() == subPathSource
214-
// must not have a join condition
215-
&& ( (SqmQualifiedJoin<?, ?>) sqmJoin ).getJoinPredicate() == null
216-
// and the same join type
217-
&& sqmJoin.getSqmJoinType() == joinType ) {
214+
// and must not have a join condition.
215+
&& ( (SqmQualifiedJoin<?, ?>) sqmJoin ).getJoinPredicate() == null ) {
216+
// We explicitly allow reusing implicit joins of any type
218217
return sqmJoin;
219218
}
220219
}

0 commit comments

Comments
 (0)