title: Hibernate custom constraint validator, how to set propertyPath explicitly?
body: <p>my custom class is implemented via:</p>
  
  <pre><code>@RequiredIfSet.List({
      @RequiredIfSet(field = "isFillingOutForSomeoneElse", dependentField = "reporterName", message = "may not be null"),
  })
  </code></pre>
  
  <p>When I loop through my ConstraintViolations and whip it to the frontend via a DTO and ajax, I have getMessage() and getPropertyPath() in a little String[].</p>
  
  <p>Works fine for everything, but propertyPath isn't set by this, as its not ON the field, its a list, how can i set it, or grab the field name to send back? Has been driving me crazy, have tried a few work around, also for note, heres where I loop:</p>
  
  <pre><code>public static &lt;T&gt; EntityValidationDTO GetEntityValidationDTO(Set&lt;ConstraintViolation&lt;T&gt;&gt; cv){
          List&lt;String[]&gt; invalidFields = new ArrayList&lt;String[]&gt;();
          Iterator&lt;ConstraintViolation&lt;T&gt;&gt; iterator = cv.iterator();
          while(iterator.hasNext()) {
              ConstraintViolation&lt;T&gt; i = iterator.next();
              String message = i.getMessage();
              String property = i.getPropertyPath().toString();
              invalidFields.add(new String[] { property, message });
          }
          EntityValidationDTO EVDTO = new EntityValidationDTO();
          EVDTO.setStatus("fail");
          EVDTO.setInvalidFields(invalidFields);
          return EVDTO;
      }
  </code></pre>