一下两段代码是同一个项目中的。第一个问题:在下面代码中@Repository("topicIndexDao")是什么意思?@Repository("topicIndexDao")
public class TopicIndexDaoImpl extends GenericIndexDaoImpl<SearchableTopic> {}
-------------------------------------------------------------------------------------
第二个问题:在下面代码中@Resource(name = "topicIndexDao")和上面的代码中的@Repository("topicIndexDao")存在关系吗?public abstract class ServiceImplBase<T> extends DaoImplBase<T> implements ServiceBase<T> {
@Resource(name = "topicIndexDao")
protected GenericIndexDao<SearchableTopic> topicIndexDao;
}
public class TopicIndexDaoImpl extends GenericIndexDaoImpl<SearchableTopic> {}
-------------------------------------------------------------------------------------
第二个问题:在下面代码中@Resource(name = "topicIndexDao")和上面的代码中的@Repository("topicIndexDao")存在关系吗?public abstract class ServiceImplBase<T> extends DaoImplBase<T> implements ServiceBase<T> {
@Resource(name = "topicIndexDao")
protected GenericIndexDao<SearchableTopic> topicIndexDao;
}
2。@Resource应该是把名字为topicIndexDao的bean节点注入到GenericIndexDao里面