Hello,
I would like to ask how (and if it is possible) to use Criteria API to create a query, which would have OR condition that either something matches in the (left) joined table or something matches in the base table.
Example: I want to get all persons which have status 'Active' or belong to some group.
Pseudo code:
ICriteria crit = session.CreateCriteria(typeof(Person));
crit.CreateCriteria("PersonGroup",JoinType.OuterLeftJoin);
crit.Add(Expression.Or(Expression.Eq("Status","Active")
Expression.Eq("PersonGroup","Some Group"))));
^ This is an error as the criteria API does not know to which table the condition belongs to.
Any help appreciated
Makli
|