开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜