![](/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.