![](/img/trans.png)
[英]How to translate 'where not in' into an NHibernate query where the subquery table is not an entity?
[英]How to translate this simple SQL query to NHibernate?
我想知道如何翻译此SQL查询以使用Criteria API。 如果不可能或不容易,HQL就可以了
SELECT * FROM Table1 WHERE Field1 in (1,2,3,4,5,6)
(1,2,3,4,5,6)
是一个外部动态数组,我将查询设置为参数,它不是常量。
ICriteria criteria = Session.CreateCriteria();
criteria.Add(Expression.In("Field1", myArray)); //where myArray is the dynamic array you say
criteria.List();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.