7.2.1.4 Basic Collection Types - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari
Version: 3.1.4
7.2.1.4 Basic Collection Types
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 = { nicknames joinTable: [name: 'bunch_o_nicknames', key: 'person_id', column: 'nickname', type: "text"] } }
--------------------------------------------- | person_id | nickname | --------------------------------------------- | 1 | Fred | ---------------------------------------------