你能发布整个NHibernate查询吗?
更新:嗯,查询显然是格式错误的:
Select distinct D from MBIgnition.Core.Domain.Model.Deal D where 1=1 and
( (D.MortgageStatus = 30 ) or
(D.MortgageStatus = 35 ) or
(D.MortgageStatus = 40 ) or
(D.MortgageStatus = 45 ) or
(D.MortgageStatus = 55 ) or
(D.MortgageStatus = 50 ) ) and
// next line is erroneous as the first AND operator does not have a lefthand side operand
(( and ( date_add_interval(D.ApprovalDate, 1, YEAR) < current_timestamp() < date_add_interval(D.RenewalDate, -1, YEAR) ) ) )
正如你所看到的,有一个
AND
代码中没有任何左侧参数的运算符。你的HQL应该有问题。再次检查它,如果您不能确定错误,那么在这里发布HQL或标准构建代码将非常有用。