我们正在使用NHibernate。有两个包含子类的IList的父类。
从桌子上我得把所有有孩子的父母都找来。我的代码如下:
String[] childs= { "Child1", "Child2" };
ICriteria criteria = Session.CreateCriteria(typeof(**Parent**));
criteria.Add(Restrictions.In("Roles", **childs**));
return criteria.List<Parent>() as List<Parent>;--这是在抛出"NHibernate.QueryException :无法使用带InExpression的集合“错误.
有人能帮忙吗。
发布于 2011-03-10 18:28:26
我相信这是您的答案,您需要在子Cannot use collections with InExpression中添加别名
https://stackoverflow.com/questions/5262741
复制相似问题