def license = new License()
def myArtist = new Artist()
myArtist.with {
name = "Tester Jester"
typeId = 2
setupById = "stagr005"
setupDate = new Date()
}
license.with {
project = "Test Oh Sweet Test"
projectTypeId = 2 // Trailer
fee = new BigDecimal("35000.00")
feeCurrencyId = 153 // US Dollars
licenseeId = 661 // Paramount
contractDate = new Date() - 10
licenseStatusId = '1' // License is in-progress
licenseTermId = 'P' // perpetual
setupById = 'stagr005'
setupDate = new Date()
// licenseProductId -- what is this for????
artist = myArtist
territory = new Territory()
}
myArtist.addToLicenses(license)
myArtist.save(failOnError: true)
I get the following error
Caught: groovy.lang.MissingMethodException: No signature of method: Artist.addToLicenses() is applicable for argument types: (License) values: [License : (unsaved)]
I was under the impression that I could use the addTo* style methods to add certain domain objects. I'm sure that I'm overlooking something obvious here, but I just can't quite figure it out. I have reviewed the Grails documentation, but could not pick up on where I'm going wrong