////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

As well as associations between different domain classes, GORM also supports mapping of basic collection types.
For example, the following class creates a `nicknames` association that is a `Set` of `String` instances:

[source,java]
----
class Person {
    static hasMany = [nicknames: String]
}
----

GORM will map an association like the above using a join table. You can alter various aspects of how the join table is mapped using the `joinTable` argument:

[source,java]
----
class Person {

    static hasMany = [nicknames: String]

    static mapping = {
       nicknames joinTable: [name: 'bunch_o_nicknames',
                           key: 'person_id',
                           column: 'nickname',
                           type: "text"]
    }
}
----

The example above will map to a table that looks like the following:

*bunch_o_nicknames Table*
[source,java]
----
---------------------------------------------
| person_id         |     nickname          |
---------------------------------------------
|   1               |      Fred             |
---------------------------------------------
----