Grails integration allows performing dynamic queries for the domain class instances. So doing, code completion makes it possible to combine different queries based on the fields of the domain classes.
- In a Grails domain class, declare fields to define mappings. For example, in the domain class
Book.groovythere are four fields:Date acquired String title String author1 String author2
- In a Grails view, controller, or test class, create a method. For example, in the
BookTests.groovy, create methodtestSomething(). - In the method body, reference a domain class to be queried, and start typing the query. Press ⌃Space or ⌃Space⌃Space or ⌃Space⌃Space or ⌃Space^ Space, ⌃Space or ⌃Space⌥ Slash, ⌥/ or ⌥/:

- Press ⌃Space or ⌃Space⌃Space or ⌃Space⌃Space or ⌃Space^ Space, ⌃Space or ⌃Space⌥ Slash, ⌥/ or ⌥/ once more, and select the desired condition from
the suggestion list:

Repeat code completion to concatenate as many search conditions as required.
The same procedure applies to the count function:

