Hi,
I am having problems defining one-to-one and one-to-many relationships with domain classes. I have the following domain classes
class Team {
static hasMany = [players: Player]
static hasOne = [coach: Coach]
}
class Person {
String name
}
class Player extends Person {
}
class Coach extends Person {
}
So my questions are:
1- Do I need to declare a variable team
in Player and in Coach ?
2- Do I need to declare a belongsTo
as well?
3- Considering the above classes, is it preferable to use hasOne?
Thank you.