可以@Repository注解被继承? [英] May @Repository annotation be inherited?

查看:1382
本文介绍了可以@Repository注解被继承?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

五月@Repository注解被继承?

May @Repository annotation be inherited?

我可能会创建一个

@Repository
public abstract class BaseRepository {
}

然后不指定@Repository注解扩展它?

and then extend it without specifying @Repository annotation?

public class MyRepository extends BaseRepository {
}

我如何知道一个注解可以遗传吗?

How do I know if an annotation can be inherited?

推荐答案

请参阅http://www.docjar.com/html/api/org/springframework/stereotype/Repository.java.html

有没有@Inherited注释,所以它是不能继承。

There is no @Inherited annotation, so it is not inherited.

这篇关于可以@Repository注解被继承?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆