Skip to content

Commit 32fdfec

Browse files
committed
Fix questionable subquery case
1 parent 4faa814 commit 32fdfec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,12 @@ void CreateFromJoinElement(
759759

760760
if (fromElement.Parent == null)
761761
{
762+
// Most likely means association join is used in invalid context
763+
// I.e. in subquery: from EntityA a where exists (from EntityB join a.Assocation)
764+
// Maybe we should throw exception instead
762765
fromElement.FromClause.AddChild(fromElement);
766+
if (fromElement.IsImplied)
767+
fromElement.JoinSequence.SetUseThetaStyle(true);
763768
}
764769
}
765770

0 commit comments

Comments
 (0)