Grails按1到多个相关对象的顺序排列

Grails按1到多个相关对象的顺序排列,grails,groovy,gsp,one-to-one,Grails,Groovy,Gsp,One To One,在grails GSP中,我做的事情如下 <g:each in="${testInstance?.testConfigs?}" var="t"> 如何更改for each循环,以便按dateCreated字段降序检索testConfigs对象?定义排序顺序不起作用吗 class Test{ static hasMany = [testConfigs:TestConfig] static mapping = { testConfigs sort:

在grails GSP中,我做的事情如下

 <g:each in="${testInstance?.testConfigs?}" var="t">

如何更改for each循环,以便按dateCreated字段降序检索testConfigs对象?

定义排序顺序不起作用吗

class Test{
    static hasMany = [testConfigs:TestConfig]

    static mapping = {
        testConfigs sort: 'dateCreated', order: 'desc'
    }
}

我确信它一定在文件里的某个地方,只是不知道在哪里。。。谢谢你没有说RTFM@Grrrrr别担心!有这么多的文档,像这样深奥的东西往往会被掩埋:-)祝你好运!
class Test{
    static hasMany = [testConfigs:TestConfig]

    static mapping = {
        testConfigs sort: 'dateCreated', order: 'desc'
    }
}