Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.3.7, 4.2.16, 6.0.0-legacy (disregard)
-
Component/s: query-hql
-
Labels:None
-
Bug Testcase Reminder (view):
-
Last commented by a user?:true
-
Sprint:
Description
A query with two conditions in the where clause doesn't work, if the first clause references a field of a one-to-one related table and the second is a subquery that references a different field of the same table in its from clause.
Example:
TestClass1 <--one to one--> TestClass2 <-one to many-> TestClass3
The following queries do work:
from TestClass1 as testClass1 where exists (from testClass1.testClass2.testClass3Set as testClass3 where testClass3.name = 'test3first')
from TestClass1 as testClass1 where testClass1.testClass2.title='test2'
The following query does not work:
from TestClass1 as testClass1 where testClass1.testClass2.title='test2' and exists (from testClass1.testClass2.testClass3Set as testClass3 where testClass3.name = 'test3first')
The same problem existed in NHibernate and was fixed:
https://nhibernate.jira.com/browse/NH-3002
This solution worked for me.
Also a similar bug is
HHH-3749
Closed
. However its fix would not help with this problem.
A test project is attached.
Attachments
Issue links
- links to