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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -