You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.