List of Strings in a Grails domain class
问题 I am trying to have a List of String that works in MySql in a Grails domain class. I have tried the following: class Catalogue { List books String book static hasMany = [books: book] } and class Catalogue { List books } and class Catalogue { String[] books } and class Catalogue { ArrayList<String> books = new ArrayList<String>() } The last three compiles but the entry is not present in MySQL. There is no table, or column to represent this data in MySQL and I have tried populating the array