I have domain like this:
class Team {
hasOne [leader: Person]
hasMany [member: Person]
}
class Person {
belongsTo [team: Team]
}
But wh
I figured that, what I need is
class Team {
belongsTo [leader: Person]
hasMany [member: Person]
}
class Person {
belongsTo [team: Team]
}
so that the Team table can have the desired "leader" reference back to Person.
Per the documentation:
Use a hasOne association to store the foreign key reference in child table instead of the parent in a bidirectional one-to-one.
You're child table here is Person and your parent is Team. Grails is working as expected.