Exception in thread "main" org.hibernate.Mappin...
2013-03-09 00:00
459 查看
建立Hibernate项目后,在src文件夹下创建包test,在该包下建立测试类,命名为Test.java。运行该程序时(Java Application),报出如下错误:
Exception in thread "main" org.hibernate.MappingException: Unknown entity:org.model.Statisticsinfo
解决办法:
在hibernate.cfg.xml中加入实体Statisticsinfo的映射,即在文件加入
<mapping resource="org/model/Statisticsinfo.hbm.xml"/>即可。
Exception in thread "main" org.hibernate.MappingException: Unknown entity:org.model.Statisticsinfo
解决办法:
在hibernate.cfg.xml中加入实体Statisticsinfo的映射,即在文件加入
<mapping resource="org/model/Statisticsinfo.hbm.xml"/>即可。
相关文章推荐
- Hibernate 5.X 版本中Exception in thread "main" org.hibernate.MappingException: Unknown entity: cn.xxx.p
- Exception in thread "main" org.hibernate.HibernateException: save is not valid without active transa
- Exception in thread "main" org.hibernate.MappingException: You may only specify a cache for root
- Exception in thread "main" org.hibernate.TypeMismatchException: Provided id of the wrong type
- Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com.xzhl.user.model/Stu
- 关于Hibernate出现找不到实体类(Exception in thread "main" org.hibernate.MappingException: Unknown entity)
- Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token:
- Exception in thread "main" org.hibernate.MappingException: You may only specify a cache for root <cl
- Exception in thread "main" org.hibernate.HibernateException: get is not valid without active transac
- Exception in thread "main" org.hibernate.InvalidMappingException: Unable to read XML
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.hibernate.domain.User
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: org.model.Kcb
- Exception in thread "main" org.hibernate.MappingException: invalid configuration
- 异常处理系列:Exception in thread "main" org.hibernate.HibernateException: Javassist Enhancement failed:cn.
- Exception in thread "main" org.hibernate.MappingException
- 关于Hibernate出现找不到实体类(Exception in thread "main" org.hibernate.MappingException: Unknown entity)
- Exception in thread "main" org.hibernate.HibernateException: No CurrentSessionContext configured!
- Exception in thread "main" org.hibernate.id.IdentifierGenerationException:
- 今天遇到了这样一个问题 Exception in thread "main" org.hibernate.LazyInitializationException: could not initiali
- Exception in thread "main" org.hibernate.HibernateException: Connection cannot be null when 'hiberna