concept Criteria query in category grails
appears as: Criteria queries, Criteria query

This is an excerpt from Manning's book Grails in Action, Second Edition.
To finish off this introduction to Criteria queries, we’d like to point out a couple of useful variants. First, you can replace the list() with either get() (if you want a single result) or count() (if you want the number of records selected by the query). Second, there’s a special withCriteria() method you can use in place of createCriteria().list():
![]()
Why would you want to use a Criteria query in place of a Where query? The examples we’ve shown so far can easily be done with the latter. The answer lies in two special types of query: dynamic and report-style. Let’s start with dynamic queries.