-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Description
For the not explicitly handled cases in HqlParser.NegateNode, a new node is created but AND/OR do not correctly replace the children with the newly created ones.
This leads to wrong sql query.
Example base query (correctly handled):
SELECT COUNT(ROOT.Id)
FROM Entity AS ROOT
WHERE (
EXISTS (FROM ChildEntity AS CHILD WHERE CHILD.Parent = ROOT)
AND ROOT.Name = 'Test'
)
Example base query (wrong):
SELECT COUNT(ROOT.Id)
FROM Entity AS ROOT
WHERE NOT (
EXISTS (FROM ChildEntity AS CHILD WHERE CHILD.Parent = ROOT)
AND ROOT.Name = 'Test'
)
Pull request is created. Problem is obvious and the fix straightforward.
As someone has stated, a similar bugfix was made in Hibernate.
I would appreciate addition to next 5.4.x release.