开发者

How to change the default setting of a domain field in Grails to be nullable

开发者 https://www.devze.com 2023-01-05 10:31 出处:网络
I want any fi开发者_运维百科eld to be nullable in default.You can place the following in grails-app/conf/Config.groovy if you are using 1.2+

I want any fi开发者_运维百科eld to be nullable in default.


You can place the following in grails-app/conf/Config.groovy if you are using 1.2+

grails.gorm.default.constraints = {
    '*'(nullable:true,blank:true)
}


From here

The defaults for nullable, blank and the other gorm constraints can be configured in Config.groovy by adding a snippet such as:

grails.gorm.default.constraints = {
    '*'(nullable:true,blank:true)
} 
0

精彩评论

暂无评论...
验证码 换一张
取 消