开发者

how to use count distinct with namedQueries in grails?

I have this :

class Contribution {
 开发者_高级运维 String name
  ...
  static namedQueries{
     findAllByName{
         'in' "name", ['bla','bla','fafa','fofo']
     }
  }
}

I use the method listDistinct and it's right. But for pagination I need to have the totalCount.

How to do that ?

Thanks.


Is it OK to add distinct to the named query? Like

  static namedQueries{
     findAllByName{
         'in' "name", ['bla','bla','fafa','fofo']
          projections {
            groupProperty("name")
          }
     }
  }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜