views:

114

answers:

1

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?

+7  A: 

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

Book.findAllByRating(4, [max:5])
j pimmel
thanks for the good link.It is very useful for me.
BlackPanther