@ExceptionHandler(ConstraintViolationException.class) @ResponseStatus(value=HttpStatus.BAD_REQUEST) public Map<String,Object> handleConstraintViolationException(ConstraintViolationException ex){
  Collection<FieldError> errors=FieldError.getErrors(ex.getConstraintViolations());
  log.warn("ConstraintViolationException: " + errors.toString());
  return LemonUtil.mapOf("exception","ConstraintViolationException","errors",errors);
}

@ ExceptionHandler ( ConstraintViolationException . class ) @ ResponseStatus ( value = HttpStatus . BAD_REQUEST ) public Map < String , Object > handleConstraintViolationException ( ConstraintViolationException ex ) { Collection < FieldError > errors = FieldError . getErrors ( ex . getConstraintViolations ( ) ) ; log . warn ( "ConstraintViolationException: " + errors . toString ( ) ) ; return LemonUtil . mapOf ( "exception" , "ConstraintViolationException" , "errors" , errors ) ; }
handles constraint violation exceptions
