O'Reilly logo

Grails 2: A Quick-Start Guide by Ben Klein, Dave Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required