日期:2014-05-17  浏览次数:20738 次

请教Spring中@Repository注解的问题
@Repository("businessDao")
public class BusinessDao extends BasicDao implements IBusinessDao {
  .....
}

在MyEclipse中@Repository("businessDao")这里的businessDao始终划红线,并提示:
The attribute value is undefined for the annotation type Repository
请问这是为什么呢?

------解决方案--------------------
Java code
@Repository(value = "businessDao")

------解决方案--------------------
Java code

import org.springframework.stereotype.Repository;

------解决方案--------------------
嗯,这个注解在org.springframework.stereotype.Repository
楼主检查下是否引用错了包,再看看spring包里是否有这个类,如果没有,就用个版本高点的包。
------解决方案--------------------
探讨

还是都不对啊

我的项目之前是在Myeclipse8.6中开发使用的,一直正常
但我觉得Myeclipse8.6太卡,就换为Myeclipse6.0,将项目导入后
就一直报此错

不知道是什么原因?

------解决方案--------------------
换高版本的JDK试试