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

View File

@ -72,6 +72,7 @@ protected void copyTo(AbstractSqmPath<T> target, SqmCopyContext context) {
// meant for assertions only
private boolean navigablePathsMatch(AbstractSqmPath<T> target) {
final SqmPath<?> lhs = getLhs() != null ? getLhs() : findRoot();
final SqmPath<?> targetLhs = target.getLhs() != null ? target.getLhs() : target.findRoot();
return lhs == null || lhs.getNavigablePath() == targetLhs.getNavigablePath()
|| getRoot( lhs ).getNodeType() instanceof SqmPolymorphicRootDescriptor;