我想像这样执行我的HQL查询:
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);
但它无法识别+order+
我需要订购条款。
答案 0 :(得分:27)
似乎你必须在HSQL查询中加上“order by”,但是有一个空格:
"from Payment where vcode=:p_Vcode or (Installment_Vcode=:installmentVcode and
payment_date>:pdate) order by vcode desc"