2 * @author Graeme Rocher
7 package org
.codehaus
.groovy
.grails
.orm
.hibernate
8 class OneToManyWithJoinTableTests
extends AbstractGrailsHibernateTests
{
10 protected void onSetUp() {
23 static hasMany = [things: Thing, moreThings:Thing]
27 moreThings joinTable:'more_things
'
36 void testOneToManyJoinTableMapping() {
37 def groupClass
= ga
.getDomainClass("ThingGroup")
38 def thingClass
= ga
.getDomainClass("Thing")
40 def g
= groupClass
.newInstance()
43 def t1
= thingClass
.newInstance()
51 g
= groupClass
.clazz
.get(1)
53 def t
= thingClass
.newInstance()
61 g
= groupClass
.clazz
.get(1)
62 assertEquals
2, g
.things
.size()