1 package org
.codehaus
.groovy
.grails
.orm
.hibernate
;
3 import org
.codehaus
.groovy
.grails
.commons
.*
4 import org
.codehaus
.groovy
.grails
.commons
.test
.*
6 class MapDomainTests
extends AbstractGrailsMockTests
{
9 def authorClass
= ga
.getDomainClass("Author")
10 def bookClass
= ga
.getDomainClass("Book")
13 def simpleAuthors
= bookClass
.getPropertyByName("simpleAuthors")
15 assert !simpleAuthors
.association
16 assert !simpleAuthors
.oneToMany
17 assert simpleAuthors
.persistent
19 def authorsProp
= bookClass
.getPropertyByName("authors")
20 assert simpleAuthors
.persistent
21 assert authorsProp
.oneToMany
22 assert authorsProp
.bidirectional
23 assert authorsProp
.association
24 assertEquals
"book", authorsProp
.referencedPropertyName
25 assertEquals authorClass
, authorsProp
.referencedDomainClass
26 assertEquals authorClass
.clazz
, authorsProp
.referencedPropertyType
31 this.gcl
.parseClass('''
37 def hasMany = [authors:Author]