Hello all,
I habe the following problem: I have an hql query where I would like to pass both order property and sort direction as a parameter. Only passing the order-by property as a parameter works fine. In such case, the query looks like the following:
select h from House h order by :pOrderBy
However, when I also try to add the sort direction as a parameter (passing effectively "asc" and "desc" using the .SetString() method), then it fails (issuing "Errors in named queries"). In such case, the query looks like the following:
select h from House h order by :pOrderBy :pSortDirection
Do you have any ideas how I could solve the problem? If possible, without using .AddCriteria(Order.Asc)
Thanks in advance!
Best regards, Martin
_________________ Tutorials and solved problems under: http://angler.wordpress.com
|