I am using custom validation in entity class, @Valid
annotation on service class not in controller class and custom exception controller(@ControllerAdvice
) in Spring Boot.
When I am using @Valid
in controller the custom annotation is throwing MethodArgumentNotValidException
and I am able to handle it.
The problem comes
when I am using @Valid
in service class the custom annotation stopped thowing exception. I want to handle custom annotation in ConstraintViolationException
. I am using custom annotation on object level not field level. Please help