Open riba2101 opened 2 months ago
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal yet complete sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
hi,
sry for the wait, was a bit busy - the repo can be found here: https://github.com/riba2101/spring-data-validaition-demo
Spring Data repository invocations are dispatched by ImplementationMethodExecutionInterceptor
. However, we still set a target source and therefore, the bean post-processor inserts MethodValidationInterceptor
at the end of the advisory chain.
If we do not set the target source in RepositoryFactorySupport
, then the bean post-processor inserts MethodValidationInterceptor
before ImplementationMethodExecutionInterceptor
and so it invokes the validator.
Have you locally tried to change RepositoryFactorySupport
to see whether the change would make sense to you?
oh, to be fair i didnt try it, a nice idea...
this would be nice to document and/or make the process easier to integrate? since the MethodValidationInterceptor
or rather the AOP validation is a global "feature" in the spring ecosystem, it would make sense to treat it as such?
If such a change works for you, then we would apply that one globally so that there's no need for customizations.
Hi,
long story short: org.springframework.aop.framework.ReflectiveMethodInvocation.proceed does not go trough the whole chain and after
RepositoryFactorySupport.ImplementationMethodExecutionInterceptor
theMethodValidationInterceptor
is not being called. That being said,MethodValidationInterceptor
should be higher up in the chain?BR