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

查看:44
本文介绍了@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天全站免登陆