Database, Grails

Grails criteria query example for unidirectional one-to-many relationships

Following is an example of unidirectional one-to-many relationship: class Employee { String name static hasMany = [roles: Role] } class Role { String name } How can we find all the employees with a particular role - "Grails Developer"? Role role = Role.findByName("Grails Developer") One way of doing...

by Aman Aggarwal
Tag: unidirectional
14-Jun-2010