关于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里面类全名

时间: 2024-11-07 04:50:58

关于An association from the table refers to an unmapped class的相关文章

An association from the table content refers to an

今天hibernate报了一个错:An association from the table content refers to an unmapped class:com.blog.content.kind 经查,发现是content.hbm.xml里面的Kind类全名错了.由于之前改动过数据库表,在content表里引入了外键kind_fk,然后用myeclipse自动生成Content类和相应的hbm.xml文件时,就会出现这样的错误!

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

运行一个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: o

关于hibernate映射过程中的笔记

MySQL遇到check the manual that corresponds to your MySQL server version for the right syntax错误 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order ' at line 1的错误,找

MySQL Temporary Table

Summary: in this tutorial, we will discuss about MySQL temporary table and show you how to create, use and drop temporary tables. Introduction to MySQL temporary table In MySQL, a temporary table is a special type of table that allows you to store a

hibernate经常报的几个不起眼的错误, 都是因为不细心或者手滑了输入有误造成了

最近会经常用到hibernate了, 也经常报错, 看着屏幕上一根大红条是非常不爽的, 这几天集合了一下经常报的错误, 整合一下放到这里, 以后再出现这个错误直接去解决就好了 1, org.hibernate.exception.ConstraintViolationException: could not execute statement 这个是最低级的错误, 刚开始的时候设置实体类的一个私有属性id, 定义了一个int型, 后来一想不对, 改成了Integer, 但是后面的get和set方

SSH集成——初级

一. struts2.x --- spring 3.x ---hibernate 3.x 1. 导入jar包:25个 mysql:一个jar spring:16个jar hibern:8个jar 2. 配置spring的applicationContext.xml文件 a) jdbc.properties的配置 <context:property-pl…… location=”classpath:jdbc.properties” ...... 关联配置文件: b) 连接池:数据源配置 <bea

Hibernate的dtd文件和properties文件

hibernate-configuration-3.0.dtd 1 <!-- Hibernate file-based configuration document. 2 3 <!DOCTYPE hibernate-configuration PUBLIC 4 "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 5 "http://www.hibernate.org/dtd/hibernate-configurat

it工程师常用英文自我介绍常用用语

Good morning ! It is really my honor to have this opportunity for an interview, I hope i can make a good performance today. I'm confident that I can succeed. Now i will introduce myself briefly I am 26 years old,born in shandong province . I was grad

Overview of Flashback Technology

Oracle Flashback Query : SELECT AS OFOracle Flashback Version Query :DBMS_FLASHBACK PackageOracle Flashback Table:Oracle Flashback Drop:Oracle Flashback Database:http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmflash.htm#i1018669 Oracle Flash