title: JSR 303 Validation Override
body: <p>How can I go about overriding the validation on the email for the AuthorizedUser in the following situation:</p>
  
  <pre><code>public class Account {
      @Length(min = 1, max = 100, 
              message = "'Email' must be between 1 and 100 characters in length.")
      @NotNull(message = "'Email' must not be empty.")
      protected String email;
  
      @Length(min = 1, max = 50,
              message = "'Name' must be between 1 and 50 characters in length.")
      private String name;
  }
  
  public class AuthorizedUser extends Account {
      @Length(min = 1, max = 40,
              message = "'Field' must be between 1 and 50 characters in length.")
      private String field;
  }
  </code></pre>
  
  <p>I know I could 'hack' the solution by overriding the email address in the setter on the AuthorizedUser by doing the following:</p>
  
  <pre><code>@Override
  public void setEmail(String email) {
     this.email = email;
     super.setEmail(" ");
  }
  </code></pre>
  
  <p>It just feels dirty... Is this possible to be overridden without writing a custom validator?</p>
  
  <p>I tried moving the @Valid to the setter in the super class, and leaving it off in the overridden field, but I still receive the message from the super class about it being empty.  Is there a lazier way to do this?</p>