Question

I have a hibernate query in grails

 Book.findAllByRating(4)

In the above query i want only 5 number of outputs.How do I limit the output to 5?

Was it helpful?

Solution

The GORM documentation has some examples of this. Have you tried out:

Book.findAllByRating(4, [max:5])
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top