reg_User 2014-12-09 07:32 采纳率: 0%
浏览 3647

No unique bean of type [] is defined

这是错误信息
No unique bean of type [com.home.web.AbsCrudDaoImpl] is defined: expected single matching bean but found 3: [agoodsCategoryDao, agoodsInfoDao, generateDao]
我是写了一个公共的dao类,然后继承这个类,下面是类一些的代码:
public class AbsCrudDaoImpl extends HibernateDaoFactory{

public Object get(Class clazz, Serializable id) throws DataAccessException {
    return getHibernateTemplate().get(clazz, id);
}

public Object load(Class clazz, Serializable id) throws DataAccessException {
    return getHibernateTemplate().load(clazz, id);
}

public Integer save(Object entity) throws DataAccessException {
    return (Integer) getHibernateTemplate().save(entity);
}
....
public class AbsCrudService<DAO extends AbsCrudDaoImpl> {

protected DAO absCrudDao;

public DAO getAbsCrudDao() {
    return absCrudDao;
}

@Resource
public void setAbsCrudDao(DAO absCrudDao) {
    this.absCrudDao = absCrudDao;
}

public Integer save(Object entity) throws DataAccessException {
    return (Integer) absCrudDao.save(entity);
}
....
public class AbsCurdController<Service extends AbsCrudService<?>> {

private static final long serialVersionUID = 1L;

protected Service service;

public Service getService() {
    return service;
}

@Resource
public void setService(Service service) {
    this.service = service;
}
  • 写回答

1条回答

  • shiter 人工智能领域优质创作者 2014-12-09 12:45
    关注

    数组没有定义?我也看的一知半解的

    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型