I got two domains on my project, first is Applicant and other is Screening.
On Applicant I got:
- String name
- String age
On Screening I got:
- String status
- belongsTo: [applicant: Applicant]
Now I would like to get all applicants with age <30 and status is hired
Here my code:
def applicant = Applicant.queryForApp(params.age)
queryForApp{age->
lt('age', age)
}
However that applicants must have status is hired. I don't know how to filter that applicant with status is "Hired" because, it's on another domain class.
Any solutions will be appreciated.