Overriding a method overrides parent annotations?

Viewed 129

Does overriding a method override parent annotations? For instance:

public interface CustomRepository {
    @Cacheable("top10UsersCache")
    List<User> getTop10Users();
}

interface CustomFeignRepository extends CustomRepository {
    @Override
    @GetMapping("top10Users")
    List<User> getTop10Users(); 
}

Method getTop10Users() (from Feign repository) it is still cacheable?

1 Answers

To inherit method / class annotations, the annotation itself must be annotated @Inherited .

Related