criteria - newbie Nhibernate join query in a DetachedCriteria -
i have domain this:
class project { ... unit projectunit } class unit { ... ilist<user> users } class user { ...
}
i have projects based on 1 user, so: each project unit.users contain query user.
how can translate detachedcriteria?
this assumes have id property on user class , you're passing in user user.
detachedcriteria query = detachedcriteria.for(typeof(project),"project") .createcriteria("projectunit","unit") .createcriteria("users","users") .add(expression.eq("id", user.id));
Comments
Post a Comment