I have a little question, I've a piece of code that build programmatically a criteria query, my problem is this, I use ICriteria.CreateCriteria to make restriction on associated class, but this compose with and clause.
Example :
NHibernate.ICriteria criteria = sess.CreateCriteria(typeof(Alert));
NHibernate.ICriteria custcriteria = criteria.CreateCriteria("Customers");
custcriteria.Add(NHibernate.Expression.Expression.Eq("Id", 39));
criteria.Add(NHibernate.Expression.Expression.Eq("Status", 3));
I need to find all alert related to customer id 39 OR status = 3, but with code above the two condition are combined with and. I cannot use disjunction because I have two distinct criteria, is there a solution without using alias?
Alk.
|