我想像这样执行我的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 by子句.
解决方法
看来你必须将“order by”放在HSQL查询中,但是有一个空格:
"from Payment where vcode=:p_Vcode or (Installment_Vcode=:installmentVcode and payment_date>:pdate) order by vcode desc"