Maintaining both sides of self-referential many-to-many relationship in Grails domain object
- by Ali G
I'm having some problems getting a many-to-many relationship working in grails. Is there anything obviously wrong with the following:
class Person {
static hasMany = [friends: Person]
static mappedBy = [friends: 'friends']
String name
List friends = []
String toString() {
return this.name
}
}
class BootStrap {
…