GORM createCriteria and list do not return the same results : what can I do?

前端 未结 6 1540
名媛妹妹
名媛妹妹 2020-12-16 23:51

I am using Nimble and Shiro for my security frameworks and I\'ve just come accross a GORM bug. Indeed :

User.createCriteria().list { 
   maxResults 10 
} 
         


        
6条回答
  •  自闭症患者
    2020-12-17 00:33

    this way you can still use criteria and pass in list/pagination paramaters

    User.createCriteria().listDistinct {
        maxResults(params.max as int)
        firstResult(params.offset as int)
        order(params.order, "asc")
    }
    

提交回复
热议问题