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

问题描述 投票:0回答:1

覆盖方法会覆盖父注释吗?例如:

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

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

方法getTop10Users()(来自Feign存储库),它仍可缓存吗?

java spring spring-boot spring-cloud-feign
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.