【发布时间】:2015-10-08 00:12:25
【问题描述】:
我正在尝试按枚举排序,但我遇到了一些错误...
这是我正在使用的代码:
and {
invoiceTicketDetail {
order('date', 'asc')
order('code', 'asc')
}
}
lineType {
order('sortOrder', 'asc')
}
lineType 是一个 Enum,并且有一个名为 sortOrder 的 int 属性,用于正确排序 lineType。 问题是当我尝试执行此操作时出现以下错误
No signature of method: InvoiceService.lineType() is applicable for argument types: (InvoiceService$_tt__getInvoiceDetailList_closure36_closure57) values: [InvoiceService$_tt__getInvoiceDetailList_closure36_closure57@3c7c8544]
Possible solutions: asType(java.lang.Class), asType(java.lang.Class). Stacktrace follows:
groovy.lang.MissingMethodException: No signature of method: InvoiceService.lineType() is applicable for argument types: (InvoiceService$_tt__getInvoiceDetailList_closure36_closure57) values: [InvoiceService$_tt__getInvoiceDetailList_closure36_closure57@3c7c8544]
Possible solutions: asType(java.lang.Class), asType(java.lang.Class)
at InvoiceService$_$tt__getInvoiceDetailList_closure36$$EPQTbhPk.doCall(InvoiceService.groovy:477)
InvoiceService 是我正在使用的服务,但它不是主要对象。如果我只是删除 lineType 行,它可以正常工作,但我需要在这个 ordenation 中添加这个 lineType。
有没有其他方法可以按复杂对象多列排序?
【问题讨论】:
标签: grails grails-orm