Grails 3.0.1 - how to configure grails.gorm.default.constraints in application.yml

廉价感情. 提交于 2019-12-01 17:18:22

问题


I took the old configuration:

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

... and put it in the application.groovy.

Luckily it worked as expected.

How would one define this in application.yml? I tried:

grails:
    gorm:
        default:
            constraints:
                '*' (nullable: true, blank: true)

but this gives errors on start.


回答1:


application.groovy is the place to do that. Groovy code in a .yml config file is invalid and not supported.



来源:https://stackoverflow.com/questions/29518459/grails-3-0-1-how-to-configure-grails-gorm-default-constraints-in-application-y

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!