我有一个BaseDAO
和一些子类,例如:UserDaoImpl
,,OrderDaoImpl
现在在一个BaseService
public abstract class Baservice{
@Resource
private BaseDao basedao;
//something crud operate.....
}
@Service
public UserService extends BaseService{
//....
}
如何配置我可以将真正的子类传递给 basedao 的 Spring
我遇到了一个例外
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.cloudking.trafficmonitor.BaseDAO] is defined: expected single matching bean but found 3: [roleDAO, userDAO