I have this simple query:
ICriteria crit = session.CreateCriteria(typeof(Article));
crit.CreateCriteria("Category", global::NHibernate.SqlCommand.JoinType.InnerJoin)
.Add(Restrictions.Eq("Name", "Fun"));
This is returning all the articles in the "Fun" category. My question is, how can I add a simple OR clause to return also any article with "Title" = "New Joke" even if it is not on the "fun" category?
Seems i cant get this working...
Edit: I know I have to swith to LeftOuterJoin, the question is about the correct syntax to build this query.
Edit2: To make this more clear, the sql query that i'm trying to build would be:
SELECT article.*
FROM article LEFT OUTER JOIN category ON (article.category = category.id)
WHERE category.name = 'fun' OR article.title = 'new joke'