Criteria API restriction over aggregate function wrapped in NotExpression is wrongly placed in WHERE clause instead of HAVING clause which generates invalid SQL
Description
introduced bug in NotExpression.GetProjections() - restriction over aggregate function wrapped in NotExpression is wrongly placed in WHERE clause instead of HAVING clause which generates invalid SQL
Thanks Filip for your test and GitHub pull-request. I have committed your changes to the NHibernate repository, and they will be in the next release.
Tom Marien
September 20, 2011 at 3:18 PM
Julian, will try to do it in the next few days thx
Julian Maughan
September 20, 2011 at 2:21 PM
Tom, I will be closing this issue if Fillip's fix is good, so you will probably need to create a new one. What we would like from you are tests to demonstrate the problem - and fixes would be even better, of course. If you clone the NHibernate repository, there are now instructions on writing tests in the root folder.
Tom Marien
September 10, 2011 at 1:52 PM
Related : Your fix is correct, but also introduced bug in combining restrictions over aggregate functions with AND/OR. Should i create new bug and fix only those two or should Filip try to add it ??
introduced bug in NotExpression.GetProjections() - restriction over aggregate function wrapped in NotExpression is wrongly placed in WHERE clause instead of HAVING clause which generates invalid SQL
test and bug fix are provided as pull request here: https://github.com/nhibernate/nhibernate-core/pull/3