class Domain {
Integer id
String url
static constraints = {
url nullable: true
}
}
null
。null
,来对应系统默认设置的 nullable: false
grails-app/conf/application.groovy
// the default value for this property is true
grails.databinding.convertEmptyStringsToNull = false
https://docs.grails.org/latest/ref/Constraints/nullable.html
原文:https://www.cnblogs.com/duchaoqun/p/12807065.html