An association from the table user_ product refers to an unmapped class: com. hiber.pojo. User

使用Hibernate框架实现多对多实体关系时,发现出现下图错误:

 An association from the table user_ product refers to an unmapped class: com. hiber.pojo. User

 错误内容没有建立映射。

 解决方案:影射文件hibernate.cfg.xml中添加使用到的类的映射代码:

       以User类为例:

       <mapping resource="com/hiber/pojo/User.hbm.xml"/>

hibernate.cfg.xml代码:

An association from the table user_ product refers to an unmapped class: com. hiber.pojo. User

User.hbm.xml代码:

An association from the table user_ product refers to an unmapped class: com. hiber.pojo. User

希望能够帮助到大家~