嗨,我有 BaseClass,它包含 @Service 注释。我想从这个类扩展我的所有类但是在 MyExtendedClass 中,@Autowired 或其他方面的内容在我将 @Service 属性添加到我的 ExtendedClass 之前不起作用。为什么这是必要的?有另一种避免重复属性的方法?我想做的是将我所有的属性都放到基类中。
@Service
public class MyBase {
public MyBase {
}
}
//Normally it doesnt have @Service annotation but not work
public class MyExtendedClass extends MyBase