9

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?

2

1 Answer 1

3
+50

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.