Reputation: 313
I have a domain class
class Something {
String name
String email
List<String> friends = []
}
In the domain class itself I have a method for Something objects which populates the friends list. But for some reason I am not able to persist this list. and it gets made null on browsing away from the gsp relevant to the domain modifying action.
Any suggestions as to why this is happening?
Upvotes: 0
Views: 1399
Reputation: 171164
I think you instead need to write your domain as:
class Something {
String name
String email
List friends
static hasMany = [ friends: String ]
}
Upvotes: 2