I\'ve just delved into a bit of NHibernate and I\'m having trouble with one of the more \'complex\' (to me!) queries I have to write. The scenario is:
I\'ve got a \'Staf
You need to
.CreateAlias("Skills", "sks")
.Add(Restrictions.In("sks.id", skillIdList))
I'm not sure if this can be done with a list of skill objects. Either way, the sql is going to end up the same as above.
Note that this will create a Cartesian product so you might want to use an exists subquery or .SetResultTransformer(new DistinctRootEntityResultTransformer())
to get back a list of distinct Staff.