0
我試圖做的Grails 1.3.4一個多一對多的關係,我得到這個異常:Grails的許多一對多的關係
Caused by: org.codehaus.groovy.grails.exceptions.GrailsDomainException: No owner defined between domain
classes [class gblog.Post] and [class gblog.Comentario] in a many-to-many relationship.
Example: static belongsTo = gblog.Comentario
爲Comentario的代碼是:
package gblog
class Comentario {
static constraints = {
}
String conteudo
Date data
static belongsTo = [post:Post, autor:Usuario]
static hasMany = [posts:Post]
}
用於郵政代碼是:
包gblog
class Post {
static constraints = {
}
String titulo
String conteudo
String palavrasChave
Date data
static belongsTo = [categoria:Categoria, autor:Usuario]
static hasMany = [comentarios:Comentario]
}
謝謝大家!
謝謝你! 過了一段時間,我看到事情是錯的。 – LaSombra 2010-08-19 11:41:23