首页 > 移动平台 > 详细

org.hibernate.MappingException: An association from the table order_intem_inf refers to a unmapped

时间:2014-10-19 01:25:37      阅读:192      评论:0      收藏:0      [点我收藏+]

运行一个HIbernate的示例时出现如下错误信息

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.hibernate.utils.HibernateUtil.<clinit>(HibernateUtil.java:21)
at org.hibernate.samples.PersonManager.main(PersonManager.java:23)
Caused by: org.hibernate.MappingException: An association from the table order_intem_inf refers to an unmapped class: Product
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1805)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1739)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1424)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
at com.hibernate.utils.HibernateUtil.<clinit>(HibernateUtil.java:16)
... 1 more

      从出错信息可知类Product没有被映射到,但是明明Product.hbm.xml文件存在,并且mapping信息也填写了啊,后来检查发现是在另一个引用到它的地方只写"Product"而不是完整的路径名。



org.hibernate.MappingException: An association from the table order_intem_inf refers to a unmapped

原文:http://blog.csdn.net/bettarwang/article/details/40247713

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!