0

I have Aspect in Spring that performs methods execution as "save(Answer)" from repository. How to correctly pass the Answer object argument in the following case:

@Before("com.examination.repository.AnswerRepository.save(answer)........//here to be continued
private void save(Answer entity) throws Throwable
       { ...}
Slavcho
  • 31
  • 8

1 Answers1

0

the annotation should be:

@Before("com.examination.repository.AnswerRepository.save() && args(answer)")

One thing though - from your code it looks like you're putting the annotation on the method you want the aspect to be called before - the annotation belongs to you aspect class, not the method you want it to be executed before

Nir Levy
  • 12,750
  • 3
  • 21
  • 38