Entity validation - "blank" property constraint inconsistently applied

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Entity validation - "blank" property constraint inconsistently applied

Roshan Dawrani
Hi,

I have an entity defined as:

@Validateable
class MyEntity {
    static constraints = {
        contactName(blank: false)
    }
}

I am observing inconsistent behavior in the validation of this entity:

1) Sometimes the constraint works as blank = BlankConstraint[false] - when it is handled by DomainClassGrailsPlugin.addValidationMethods() closure.

2) Other times the constraint works as blank = BlankConstraint[false] + NullConstraint[false] - when it is handled by ValidationGrailsPlugin.addValidationMethods() closure.

Does anyone see why I am seeing this inconsistent bahavior? Why is the entity.validate() call is not handled consistently by one of these plugins?

What is supposed to be the meaning of "blank: false"? Does it implicitly include "null: false"?

--
Roshan