DATAREST-798 - Fixed invalid implementation of ValidationErrors.
Changed the implementation of ValidationErrors to be based on AbstractBeanPropertyBindingResult to consider the nesting implemented in superclasses and using a PersistentPropertyAccessor to lookup the property values. ValidatingRepositoryEventListener now uses this implementation if a PersistentEntity can be obtained for the type under consideration, falling back to a DirectFieldBindingResult otherwise.
This commit is contained in:
@@ -39,8 +39,8 @@ public class RepositoryConstraintViolationExceptionMessage {
|
||||
|
||||
String message = accessor.getMessage(fieldError);
|
||||
|
||||
this.errors.add(new ValidationError(fieldError.getObjectName(), message, String.format("%s",
|
||||
fieldError.getRejectedValue()), fieldError.getField()));
|
||||
this.errors.add(new ValidationError(fieldError.getObjectName(), message,
|
||||
String.format("%s", fieldError.getRejectedValue()), fieldError.getField()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user