How do I use order by in HQL?

hql, java

Solution

appears you have to put the "order by" in the HSQL query, but with a space:

"from Payment where vcode=:p_Vcode or (Installment_Vcode=:installmentVcode and
payment_date>:pdate) order by vcode desc"

Problem

I want to execute my HQL query like this: ``` Query queryPayment=sixSession.createQuery("from Payment where vcode=:p_Vcode or (Installment_Vcode=:installmentVcode and payment_date>:pdate) order byvcode."+order +"desc") .setParameter("p_Vcode", p_Vcode) .setParameter("installmentVcode", installmentVcode) .setParameter("pdate", pdate); ``` but it does not recognize `+order+` I need the order by clause.

Original source