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