Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails 3.3.1 - Register new constraint

In previous versions of Grails, I could call:

grails.validation.ConstrainedProperty.registerNewConstraint(
                constraintName,
                constraintClass)

But now grails.validation.ConstrainedProperty is deprecated, and the class to use instead, grails.gorm.validation.ConstrainedProperty, does not have the method registerNewConstraint.

How can I register a new constraint in Grails 3.3.1?

like image 300
Anonymous1 Avatar asked Sep 26 '17 06:09

Anonymous1


1 Answers

Since grails 3.3.x you can't register constraints with the ConstraintedProperty the package doesn't matter. You should use the ConstraintRegistry. See the part Grails Validator and ConstrainedProperty API Deprecated of grails documentation

like image 175
Beno Arakelyan Avatar answered Oct 11 '22 18:10

Beno Arakelyan