当前位置: 代码迷 >> Eclipse >> Hibernate 的有关问题(,小弟我只有10分了)
  详细解决方案

Hibernate 的有关问题(,小弟我只有10分了)

热度:42   发布时间:2016-04-23 18:42:35.0
Hibernate 的问题(高手指点,我只有10分了)
我用ecilpse+myecilpse   做一个程序,当运行到
Session   session   =   HibernateSessionFactory.getSession();这条代码时
就报错:%%%%   Error   Creating   SessionFactory   %%%%
org.hibernate.MappingException:   entity   class   not   found:   CustomerInfo
我是创建了这个实体类,但是我没有调用过,为什么报这个错?
高手指点!!我只有10分了

------解决方案--------------------
你的 HibernateSessionFactory.java中 private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml ";hibernate.cfg.xml存放路径正确吗。
------解决方案--------------------
你的与CustomerInfo类相关的映射文件有错误。
<class name= "com.entity.TblBsDictType--这个地方的路径不对 ">

</class>

检查一下.hbm.xml配置文件,应该可以解决
  相关解决方案