Hi,
I need to add an "order by" clause to the named query so the question is whether it is possible at all and how to if yes. What I would like to achieve is to add optionally ordering of the result of the original query:
Code:
IQuery q = sess.GetNamedQuery(...);
// here we set parameters to the query...
if(paging)
{
q.SetFirstResult(...);
q.SetMaxResults(...);
}
if(applyOrder)
{
// here to add order by stuff to the query?
}
q.List();
This seems to be quite typical scenario for DAO implementations and in case of criteria it is quite easy to do... but I need (for now) it for case of HQL queries.
TIA