nhibernate/nhibernate-core — pull request #388 by gliljas (2014-12-07 21:39:02+00:00)
Title: Partial fix for NH2504 - Can't use Cacheable with Group By

This fixes the second case mentioned in the JIRA issue (and the one I needed to fix). Applying Cacheble earlier in the query still throws an exception. That is of course fixable, but IMHO I think the problems are caused by treating Cacheable as ResultOperator. Both Cacheable and Timeout are environmental query settings, and letting them pollute and complicate the expression tree and the handling of this tree is really unnecessary. I think we could reduce complexity and solve a couple of outstanding issues by investingating and removing MethodCallExpressions to Cacheable and Timeout, before all the other tree parsing commences.