Grails mapping sort on multiple fields :: Groovy sort on multiple map entries

后端 未结 3 2009
生来不讨喜
生来不讨喜 2020-12-09 09:53

Stumped on this one. In Grails it seems one cannot define a default sort on multiple columns in domain mapping a la static mapping = { sort \'prop1 desc, prop2 asc\' }, or

3条回答
  •  萌比男神i
    2020-12-09 10:46

    Thanks to the link from GreenGiant, we see that the issue is closed as fixed as of version 2.3.

    There is also example code:

    static mapping =
        { sort([lastname:'asc', name:'asc']) }
    

    It is working for me in 2.4.3

提交回复
热议问题