Hibernate Criteria Builder
Dynamic finders are great, and as you work with Grails, you will find yourself using them again and again, but they can take you only so far. For one thing, they are limited to top-level properties of the class—you cannot use dynamic finders to search relationships.
Our next search feature is to find TekEvent instances for which a logged-in user has volunteered. Volunteers for an event are in the volunteers collection, which is the result of a one-to-many relationship between TekEvent and TekUser. To search relationships, we must turn to a different tool in the Grails toolbox.
The Criteria Builder in Grails is a very powerful and flexible tool for retrieving objects. It is based on the Hibernate Criteria API, so ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access