c# - Restrict QueryOver by child collection using nHibernate -
i trying parent entity entities in child collection in list. for example: public class parent { public virtual int id {get;set;} public virtual list<child> children {get;set;} } public class child { public virtual int id {get;set;} public virtual string name {get;set;} } i've tried various combinations of joins , restrictions can't seem hit spot. so please suggestions. current example below: public ilist<lead> getallavailable(string[] names) { var result = session.createcriteria<parent>() .createcriteria("children") .add(expression.in("name", names)).list<parent>(); return result; } edit: this sql equivilent: select * dbo.parent join ( select p.id dbo.parent p join dbo.parenttochildren on p.id = dbo.parentstochildren.parent_id join dbo.child on dbo.parenttochildren.child_id = d