The solution

Each class that implements Validator has a crossFieldValidation method where you must place any logic which validates the value in one field against one or more others.

If single-field and mandatory-field validation has succeeded, then the persistence infrastructure automatically calls crossFieldValidation prior to any insert or modify operation (but not before a physical remove operation), and fails the operation if any validation errors have been raised. In particular, processing will not proceed to cross-entity validation if any cross-field validation errors have been found. The persistence infrastructure will prevent any database access occurring during crossFieldValidation.