title: How to validate 2 field with OR condition?
body: <p>I want to validate two fields of a Request Class in manner that Either one field is valid OR another field is valid. </p>
  
  <p>Eg:
  Request Bean</p>
  
  <pre><code>public class CarRequest  {
      @NotEmpty
      private String customerName;
      @NotEmpty
      private String customerId;
  </code></pre>
  
  <hr>
  
  <p>Controller Method</p>
  
  <pre><code>    public @ResponseBody CarResponse addCar(
              @ModelAttribute @Valid CarRequest request, BindingResult results)
              throws RuntimeException, ValidationException {
          if (results.hasErrors()) {
              LOG.error("error occured while adding the car");
              throw new ValidationException(
                      "Error Occoured while validiating car request");
          }
  }
  </code></pre>
  
  <p>Here I want to check that either customerName should be NotEmpty OR customerId should be NotEmpty. then my validation should pass. How can I implement it . Please suggest!!</p>