New validation API usage in Class Constraint Validator

The code in the documentation about Class Constraint Validator was still using the deprecated validation API