So I have a 1:1 relationship:
class Number1 {
Number2 n2
}
class Number2 {
belongsTo = [n2: Number2]
}
Now, I want to initialize n2 in class Number1 like:
class Number1 {
Number2 n2 = New Number2(...).save()
}
But Grails is failing with hibernate exceptions. What's the best practice here for initializing a field with this relationship?