关于An association from the table refers to an unmapped class

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于An association from the table refers to an unmapped class相关的知识,希望对你有一定的参考价值。

今天配置SSH框架的时候出现这个异常,找了很久,才发现原来是是实体类映射文件中的<class name="Role" table="role">的name值写错了,这里总结了一些网上的常见错误原因:

1,检查你的hibernate.cfg.xml文件中是否添加了  <mapping resource="xxxx.hbm.xml"/>
2,检查你的hibernate.cfg.xml文件中的相关联的两个<mapping resource=""/>的顺序,可能有其中一个需要引用另一个,但是另一个却还没有编译,就是说被用作外键的表要放在前面
3,检查你的*.hbm.xml文件名是否正确
4, 检查你的*.hbm.xml里面类全名

以上是关于关于An association from the table refers to an unmapped class的主要内容,如果未能解决你的问题,请参考以下文章

Linq------错误: Unable to determine the principal end of an association between the types

The prefix "p" for attribute "p:message" associated with an element type "b

[Functional Programming] Randomly Pull an Item from an Array with the State ADT (Pair)

Creating an archive from a directory without the directory name being added to the archive

An unexpected error prevented the server from fulfilling your request. (HTTP 500)

An unexpected error prevented the server from fulfilling your request. (HTTP 500)