通过在Grails Controller中的HQL中不工作来排序

时间:2014-07-14 05:43:27

标签: grails sql-order-by hql

我的控制器内有以下内容

def pgtyp = Pgtyp.executeQuery("select p.date_hour,p.visits, p.mv, p.browser,p.pagetype,p.platform,p.device 
           from Pgtyp p 
           where p.pagetype = ? and p.device = ? and p.browser = ? and p.platform = ? order by p.date_hour[params.pagetype,params.device,params.browser,params.platform])   

当我添加'order by p.date_hour'时,我收到以下错误:

java.lang.RuntimeException: FileWatcher caught serious error, see cause

我是否有其他方式在HQL中通过date_hour执行订单。我如何按工作制作此订单?

1 个答案:

答案 0 :(得分:0)

这对我有用。!

order by col_0_0_ asc  which is col_[fieldnumber]_0

将第一个选定字段计为0作为fieldnumber