|
|
|
I changed this to critical as I found some other problem related to the naming of the association columns.
class Actor { static belongsTo = Film String firstName static constraints = {
firstName(maxSize:45)
lastName(maxSize:45)
} static hasMany = [actors:Actor] String title static constraints = { title(maxSize:255) description(blank:true, nullable:true, maxSize:65535) releaseYear(nullable:true, range:1900..2100) rentalDuration(min:1, max:127) rentalRate(min:0.00, max:99.00, scale:2) length(nullable:true, min:1, max:32767) replacementCost(min:0.00, max:999.00, scale:2) rating(inList:["G", "PG", "PG-13", "R", "NC-17"]) } } When you have the domain classes as above Grails will automatically create the film_actor table containing:
Now the critical part is that it appears that actors_id references the film table and films_id references the actor table... Should be the other way around I think. PS again the custom ORM mapping could be used to fix it:
class Actor { class Film { Should have looked on user forum and JIRA first.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
class Group {
...
static mapping = { people column:'person_id' }
}
class Person {
...
static mapping = { groups column:'group_id' }
}