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")
}
}
}
精彩评论