In my Grails domain I have something like the following
class A {
String name
static hasMany = [ b : B ]
SortedSet b
static fetchMode = [ b:"eager" ]
}
class B implements Comparable{
A a
... compareTo method defined ....
}
What I'm trying to do is to retrieve an instance of class A, and at the same time have its collection (b) populated.
So I do A.get(1), expecting b to be populated,
but b.each(){ println it }
tells me that I'm calling each on a null object
I fear that I am fundamentally missing the point here, but I can't see what I'm doing wrong.
I'm running this as as integration test, against a MySql database. The database appears to be populated with data that would allow the association between A and B.
Any help greatly appreciated.
Dave