class Book {
String name
String author
static constraints = { name(nullable:true)
}
}
上面似乎工作,但是当我把在多个领域的约束服务器启动不起来格姆实体约束
class Book {
String name
String author
static constraints = { name(nullable:true) author(nullabe:false)
}
}
与上面的代码......我得到的下面例外
所致:groovy.lang.MissingMethodException:方法的无签名:org.codehaus.groovy.grails.validation.ConstrainedPrope rty.call()是适用于参数类型:(org.codehaus.groovy .grails.va lidation.ConstrainedProperty)values:[org.codehau [email protected] [class com.nthdimenzion.domain.Book,author,class java.lang.String,{nulla ble = org.codehaus。 [email protected] [false]}]] 可能的解决方案:wait(),any(),wait(long),each(groovy.lang.Closure),any(groovy.lang.Closure), ISURL() 在com.nthdimenzion.domain.Book $ _ clinit _closure1.doCall(Book.groovy:16) 在com.nthdimenzion.domain.Book $ _ clinit _closure1.doCall(Book.groovy) ... 23更多
任何想法?
谢谢你是这个问题:) – Sudarshan 2011-05-10 09:36:57