1


I wonder how to translate this sql query to use the Criteria API. If not possible or not easy, HQL would be OK

SELECT * FROM Table1 WHERE Field1 in (1,2,3,4,5,6)

(1,2,3,4,5,6) is an external dynamic array that I set to the query as parameter, it's not a constant.

1 Answer 1

4
ICriteria criteria = Session.CreateCriteria();
criteria.Add(Expression.In("Field1", myArray)); //where myArray is the dynamic array you say
criteria.List();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.