Rather than do a String.Format, ActiveRecord has a Query.SetParameterList(“Param”, IList
string hql = String.Format("FROM MyObject o WHERE o.Pk.Key in (:keys) ORDER BY o.SomeColumn");
SimpleQuery<MyObject> q = new SimpleQuery<MyObject>(hql);
q.SetParameterList("keys", lstKeys);
q.SetQueryRange(25);
MyObject[] result = q.Execute();