Skip to main content

Posts

Showing posts from December 13, 2013

Grail All Domain class Variables By Default null.

Many of the time we have the need that to make the Grail domain class variables as null; where as Grail implicit concept is all the variables of domain class are not null, so we will have to make the static constraints{nullable:true} many times for each variable. where as we have a sweet option via which we can make all the domain class variables by default null and can overwrite the behavior to not null in constraints declaration block. To make the by default null behavior for each domain class we will have to put the below code snippet on config.groovy file. grails.gorm.default.constraints = {'*'(nullable: true)}