2 u011913811 u011913811 于 2013.10.30 18:15 提问

hibernate注解实体类对应数据库字段,出了问题?请教

我在用注解写对应数据库的映射文件时候 搞了个单元测试 结果就报了异常 :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDao': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.orm.hibernate3.HibernateTemplate com.lesta.core.dao.impl.BaseDao.hibernateTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [modules/spring.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [modules/spring.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Collection has neither generic type or OneToMany.targetEntity() defined: com.lesta.gaojing.model.Bkaction.bukongs

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!