-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
Description
Original problematic query from hibenate issue looks like:
SELECT s.studentId, q.questionId, sa.answer
FROM Student s, Question q
LEFT JOIN s.studentAnswerList AS sa WITH sa.question.questionId = q.questionId
Test simulating such query was added here:
nhibernate-core/src/NHibernate.Test/Hql/EntityJoinHqlTest.cs
Lines 124 to 138 in 11bc49d
[Test, Ignore("Failing for unrelated reasons")] | |
public void CrossJoinAndWithClause() | |
{ | |
//This is about complex theta style join fix that was implemented in hibernate along with entity join functionality | |
//https://hibernate.atlassian.net/browse/HHH-7321 | |
using (var sqlLog = new SqlLogSpy()) | |
using (var session = OpenSession()) | |
{ | |
session.CreateQuery( | |
"SELECT s " + | |
"FROM EntityComplex s, EntityComplex q " + | |
"LEFT JOIN s.SameTypeChild AS sa WITH sa.SameTypeChild.Id = q.SameTypeChild.Id" | |
).List(); | |
} | |
} |
NHibernate currently generates joins in wrong order
FROM fromTable
LEFT JOIN leftJoin ON leftJoin.someId = thetaJoin.someId
, thetaJoin