Closed
Description
Tomer Avissar created an issue — 13th November 2007, 8:34:03:
Exception occurs when using criteria exist queries
When using a Criteria query with Exist with subquery, a
QueryException
is raised. The exception is handled, quoting the remark://not found in inner query , try the outer query
The query executes successfully, but causes a significant performance overhead because of the exception.
This can easily be reproduced, for example:
DetachedCriteria dc = DetachedCriteria.For(typeof(Employee)) .SetProjection(Projections.Id()) .Add(Expression.Eq("FirstName", "David")) .Add(Property.ForName("Department.Id").EqProperty("department.Id")); IList<Department> departments = session.CreateCriteria(typeof(Department), "department") .Add(Subqueries.Exists(dc)) .List<Department>();
Karl Chu added a comment — 22nd April 2008, 16:45:06:
Changing this to "improvement" as it behaves correctly... albeit a little slow.