简体   繁体   English

覆盖方法会覆盖父注释吗?

[英]Overriding a method overrides parent annotations?

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?方法getTop10Users() (来自 Feign 存储库)它仍然可以缓存吗?

要继承方法/类注解,注解本身必须被注解@Inherited

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM