5.2.1.4 基本的集合类型 - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith
Version: null
5.2.1.4 基本的集合类型
As well as associations between different domain classes, GORM also supports mapping of basic collection types. For example, the following class creates anicknames association that is a Set of String instances:class Person {
static hasMany = [nicknames: String]
}joinTable argument:class Person { static hasMany = [nicknames: String] static mapping = {
hasMany joinTable: [name: 'bunch_o_nicknames',
key: 'person_id',
column: 'nickname',
type: "text"]
}
}--------------------------------------------- | person_id | nickname | --------------------------------------------- | 1 | Fred | ---------------------------------------------

