June 2014
Intermediate to advanced
576 pages
19h 26m
English
As you saw in the main chapters, Grails gives you plenty of options when it comes to querying. Of those, in this appendix, we focus on Where and Criteria queries, which are closely related. We detail the syntax for both options and also show you how the criteria map between the two. This will allow you to convert between Where and Criteria queries. For example, you may find the query you need in an online blog post in Criteria query form, whereas you may want to use Where queries exclusively in your code.
You can invoke Where queries in several different ways:
def result = <domainClass>.where { <criteria> }.list() def result = <domainClass>.where { <criteria> }.get() def result = <domainClass>.where ...Read now
Unlock full access