0
我的域名:NHibernate的:有利於構造查詢
class Product
{
IList<Income> Incomes {get; set;}
Category Category {get; set;}
}
class Income
{
Product Product {get; set;}
int Quantity {get; set; }
}
我需要查詢其收入的數量之和產品> 0,我能夠與查詢做到這一點:
ICriteria criteria = session.CreateCriteria(typeof (Income))
.SetProjection(Projections.GroupProperty("Product"))
.Add(Restrictions.Ge(Projections.Sum("Quantity"), 1));
然而,我需要根據產品屬性篩選和排序查詢結果的可能性 - 這就是我遇到問題的地方 - 總是得到像column "p1_.id" must appear in the GROUP BY clause or be used in an aggregate function
謝謝!我幾乎要開始賞金這個問題) – kilonet 2010-09-13 18:37:29
太糟糕了,我沒有等,然後;-) – 2010-09-13 18:46:17