Ok Tracked down issue NH-1280 is faulty, and does not fully implement having clause
For instance NotExpression.GetProjections() should not return null, but the nested criterion's projections, same counts for Or,And,Junction,Disjunction Please advice on what's next here, because i need to get this fixed So for a not expression it is easy i just return nested criterions.projections But what must i do for Or,And,Junction,Disjunction etc should it return a new IProjection[] with left and right projections ??? On 3 mrt, 12:52, Nexus <[email protected]> wrote: > As an update on this it seems that not, or etc seems to block this > Having clause > > consider following table > > ProductStock > { > StockID Guid > ProductID Guid > Qty bigint > > } > > wanna do this query trough criteria api > > SELECT ProductID , sum(Qty) from Productstock > Where productid = "SOme id) > GROUP BY ProductID > HAVING Sum(Qty) <> 0; > > CriteriaApi > > var crit = DetachedCriteria.For<ProductStock>() > .SetProjections(ProjectionList.Add(Projection.GroupProperty("ProductID")).Add(Projections.Sum("Qty"))) > .Add(Restrictions.Not(Restrictions.Eq(Projections.Sum("Qty"),0)); > > This does not work for some reason when i strip not it works > > Please advice > > On 2 mrt, 13:28, Nexus <[email protected]> wrote: > > > Hi > > > I am using 2.1.2 GA, when i try to use a > > Add(Restrictions.Gt(IProjection projection,0) || > > Restrictions.Gt(IProjection projection,0) ) > > > It is no longer using having clause and totally screws up query, when > > i use a single query or add multiple (AND) it works but also not when > > using && > > > Any idea ? -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
