The NoteBook of EricKong

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks
 1,检查你的hibernate.cfg.xml文件中是否添加了  <mapping resource="xxxx.hbm.xml"/>
2,检查你的hibernate.cfg.xml文件中的相关联的两个<mapping resource=""/>的顺序,可能有其中一个需要引用另一个,但是另一个却还没有编译,就是说被用作外键的表要放在前面
3,检查你的*.hbm.xml文件名是否正确
4, 检查你的*.hbm.xml里面类全名
posted on 2010-05-12 15:24 Eric_jiang 阅读(21566) 评论(8)  编辑  收藏 所属分类: Hibernate

Feedback

# re: 关于An association from the table refers to an unmapped class 2011-06-13 23:36 bujidelebaba
顶。我一个个对照下去发现原来是hbm.xml里的类全名写错了  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class 2011-06-13 23:40 bujidelebaba
哎,改了也还是不行不知道是哪里的问题  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class 2011-06-14 01:06 bujidelebaba
问题终于解决了,我来分享一下我的问题,我的.hbm.xml是我利用database explore下的反向工程自动生成的,是放在src目录下的,后来我转移到了自建的bean目录下,未将.hbm.xml中的class改正,如果放在src下默认只有类名,如<class="User">,我将它改成我现在的目录<class="bean.User">就OK了  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class[未登录] 2012-09-23 11:29 ff
我还是没有找到哪里的错  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class 2012-12-20 11:19 姓名
我说一下我的错误。主要是包弄错了。<hibernate-mapping package="***.***">看看你是不是没有定义包名而下面用到的class = “**”没有用包名。我找了很长时间才知道。也是比较笨~  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class 2013-01-10 17:17 ljmzy
@姓名
是的,我也犯错了!该死!  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class 2013-09-17 10:51 赵才会
hibernate.cfg.xml文件没配置  回复  更多评论
  

# re: 关于An association from the table refers to an unmapped class 2014-12-22 19:38 aiko
顶 我是**.hbm.xml中的类全名写错了  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: