I have a course domain
class Course { String name static hasMany = [categories: Category] }
Category Domain Class
class Category { String name }
therefore, a course here can have several categories.
Now I want to find all courses in which there is a category whose id 4
I tried to write an HQL query:
def courseList = Course.findAll("from Course as c where c.categories.id in (4)")
which gives an error.
How to write the correct HQL or the correct criteria query?
source share