What's up? folks!
I'm trying to intercept all classes that contains a specific word in their names... something as below:
@Before("execution(* com.domain.model.*.*Repository.save(..))")
I have the following methods to intercept:
com.domain.model.user.UserRepository.save(User user);
com.domain.model.xpto.XPTORepository.save(XPTO xpto);
com.domain.model.foo.FooRepository.save(Foo foo);
I have tried this: (worked, but looks horrible)
@Before("execution(* *.save(..)) && within(com.domain.model..*)")
public void validateBeforeSave(final JoinPoint jp) throws Throwable {
if (jp.getSignature().toString().contains("Repository.")) {
...
}
}
Thanks!!!