Linq query with Any operator creates wrong results

Description

Linq's .Any operator is apparently not translated to valid HQL. In the attachment, there are two test cases for an .Any behind a ! (not) and an .Any containing || (or):

I argue that this bug is critical because

  • the tests do not throw an exception, i.e., one might assume that the result is correct when it is not.

  • Workarounds are hard - they need to rewrite the complete expression. Especially when the expressions are built algorithmically (e.g. depending on user input), this may be next to impossible.

I risk to predict that correctly translated HQL would then create wrong SQL - see issue NH-2648. Therefore, both these issues probably need to be solved at the same time.

Environment

None

Attachments

1

Activity

Alex Zaytsev 
August 30, 2020 at 8:44 PM

Not an issue as per Gunnar's comment: "The error in in the unit test, which doesn't set the Parent property of the Child, as required by the inverse mapping".


Moved here.

Gunnar Liljas 
December 8, 2014 at 9:11 PM

This can be closed. The error in in the unit test, which doesn't set the Parent property of the Child, as required by the inverse mapping.

Not an Issue

Details

Assignee

Reporter

Labels

Components

Priority

Who's Looking?

Open Who's Looking?
Created April 13, 2011 at 2:59 AM
Updated August 30, 2020 at 8:44 PM
Resolved August 30, 2020 at 8:44 PM
Who's Looking?