您的位置:首页 > 其它

hibernate一对多映射时异常Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @Collection

2016-10-09 11:26 465 查看
      异常信息:  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [spring/applicationContext-db.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 [spring/applicationContext-db.xml]: Invocation of init
method failed; nested exception is org.hibernate.AnnotationException:Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: com.PLCmonitor.domain.CraneQueryTimes.users

      解决方法:private ArrayList<User> user=new ArrayList<User>();换成private List<User> exams=new ArrayList<User>();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐