I want a many-to-many relationship. Then i have to specify a belongsTo at one side like:
static belongsTo = Answer
But i already have specified a belongsTo as a Map: here the Code
class Answer {
String text
static hasMany = [users:User, filters:Filter]
static belongsTo = [question:Question]
}
class User {
String name
static hasMany = [answers:Answer]
static belongsTo = Answer
}
class Filter {
String name
static hasMany = [answers:Answer]
static belongsTo = [user:User]
//static belongsTo = Answer
But I can't specify an owner in the Filter because I already have the user owner for the Filter...
How do I do this?
edit: sorry figured out the solution by myself:
class Filter {
String name
User user
static hasMany = [answers:Answer]
static belongsTo = [User, Answer]
}