HHH-17407 Fix navigable path assertion for correlated entity joins

This commit is contained in:
Marco Belladelli 2023-11-20 12:48:33 +01:00
parent 6ee5f116ed
commit eab28b3bf2
1 changed files with 1 additions and 0 deletions

View File

@ -72,6 +72,7 @@ public abstract class AbstractSqmPath<T> extends AbstractSqmExpression<T> implem
// meant for assertions only // meant for assertions only
private boolean navigablePathsMatch(AbstractSqmPath<T> target) { private boolean navigablePathsMatch(AbstractSqmPath<T> target) {
final SqmPath<?> lhs = getLhs() != null ? getLhs() : findRoot();
final SqmPath<?> targetLhs = target.getLhs() != null ? target.getLhs() : target.findRoot(); final SqmPath<?> targetLhs = target.getLhs() != null ? target.getLhs() : target.findRoot();
return lhs == null || lhs.getNavigablePath() == targetLhs.getNavigablePath() return lhs == null || lhs.getNavigablePath() == targetLhs.getNavigablePath()
|| getRoot( lhs ).getNodeType() instanceof SqmPolymorphicRootDescriptor; || getRoot( lhs ).getNodeType() instanceof SqmPolymorphicRootDescriptor;