Hi,
I have this query, it works good (this is a n:m relation!):
Code:
IQuery query = nhSession.CreateQuery("from Product prod inner join fetch prod.ProdPerCategory aProd where CategoryId = :catID ")
.SetParameter("catID", cat.Id);
proResult = query.List<Models.Product>();
My Question is: how to change this query to this form:
Quote:
IList test = nhSession.CreateCriteria(typeof (Product), "pr")
.CreateCriteria("ProdPerCategory", "ppc", NHibernate.SqlCommand.JoinType.InnerJoin)
.Add(Expression.Eq("CategoryId", cat.Id))
.List(); <-- dont works !!!
Thanks