Hello,
In our linq-to-nhibernate implementation, we're using
Criteria api and we're trying to improve criteria api when it lacks of
some ability we need.
This issue(NH1380) is one of the features that we depend on for some cases.
This include cases like nested queries, or Chained skip & take operations(
http://jira.nhibernate.org/browse/NHLQ-1) and some others.
I will be spending some time on it, and plan to create patch if I can get something working.
This feature will require modification to both criteria and detachedcriteria.
What I plan to end up with is that
DetachedCriteria innerClause=DetachedCriteria.
For<Person>();
innerClause.AddOrder(Order.Asc("PersonName"));
innerClause.SetMaxResults(10);
innerClause.SetFirstResult(4);
innerClause.SetProjection(Projections.ProjectionList().Add(Projections.Property("Name"));
DetachedCriteria innerClause2=DetachedCriteria.AboveSubquery(innerClause);
innerClause2.SetMaxResults(3);
innerClause2.SetMaxResults(5);
ICriteria criteria=innerClause2.GetExecutableCriteria(session);
IList results=criteria.List();
Is that a good end result? Should I go for Criteria one instead of DetachedCriteria?
And I really wonder how much refactor this will need because not sure if it is too much for me.
And maybe somebody could do it before me, i would really appreciate it.
--
Tuna Toksöz
Typos included to enhance the reader's attention ...