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.