I have the following domain structure:
class Survey { Integer id String title static hasMany = [questions: Question] static constraints = { id() title() questions() } String toString(){ return title } } class Question { Integer id String text static hasMany = [responses: Response] static fetchMode = [responses: 'eager'] static constraints = { id() text() responses() } String toString(){ return text } } class Response { Integer id String text Integer numberOfPeopleSelected = 0 static constraints = { id() text() numberOfPeopleSelected() } String toString(){ return text } }
I modified Bootstrap.groovy to initialize some data at startup, and separate calls to Survey.list() , Question.list() and Response.list() show that each individual level is created with the expected values
However, when I do Survey.list() and deal with questions, the answers are always null:

I expected that by setting fetchMode it should always load this particular object.
What can I change on my domain objects to make sure that when I do something like Survey.findById(1) , it downloads all the questions and answers?
thanks
Jimmy source share