I have two classes, each in a different packages and there is a one-to-many relationship between them. How is this done? I have:
package one
class History {
String name
static hasMany = [fielderror:FieldError]
}
package two
class FieldError {
String fieldName
static belongsTo = [history:History]
}
If they were in the same package, this would work, but they are not. The error in package one is:
Groovy:Apparent variable ‘FieldError’ was found in a static scope but doesn’t refer to a local variable, static field or class.
So I guess I need to make package one aware of package two and vice versa. How?
Add an import like for any class in another package: