【hibernate错误】An association from the table refers to an unmapped class
来源:互联网 发布:数据挖掘分析师 编辑:程序博客网 时间:2024/05/16 19:39
完整错误提示
Caused by: org.hibernate.MappingException: An association from the table T_MATERIAL_IN_DETAIL refers to an unmapped class: com.hcepms.model.cost.contract.ContractDetail at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.secondPassCompileForeignKeys(InFlightMetadataCollectorImpl.java:1837) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.secondPassCompileForeignKeys(InFlightMetadataCollectorImpl.java:1808) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1627) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:278) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:692) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:727) at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:416) at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:401) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579) ... 35 more
解决思路
- 找到这个对象,看对象的数据库名字和model名字是否对应一致
- 找到错误class,看是否是类全名写错导致的。(大部分人是这个原因)
我的bug
由于是分布式开发,合同模块是别人做的,他只写了model,并没有写hbm文件,结果hibernate在映射过程中,通过这个model无法映射到数据库,报错了。
将缺失的hbm文件添加上即可。
阅读全文
0 0
- hibernate错误:An association from the table ....... refers to an unmapped class
- 【hibernate错误】An association from the table refers to an unmapped class
- An association from the table * refers to an unmapped class: *
- An association from the table refers to an unmapped class
- An association from the table * refers to an unmapped class: *
- An association from the table refers to an unmapped class
- org.hibernate.MappingException: An association from the table tuser refers to an unmapped class: Role
- Hibernate:关于An association from the table refers to an unmapped class
- org.hibernate.MappingException: An association from the table STREET refers to an unmapped class: e
- org.hibernate.MappingException:An association from the table XX refers to an unmapped class
- 2.An association from the table refers to an unmapped class:错误
- SSH错误:An association from the table orderitem refers to an unmapped class
- An association from the table emps refers to an unmapped class: Dept 错误解析
- 映射异常: An association from the table tb_baoxiao refers to an unmapped class: int
- An association from the table work_output refers to an unmapped class: org.ejs.sys.model.Part
- 关于An association from the table refers to an unmapped class
- An association from the table PersonAddress refers to an unmapped class
- 映射异常: An association from the table TBL_TRAIN_COURSE_MONTH_PLAN refers to an unmapped class
- 替代WinPcap的新型Windows网络数据包截获软件——NPcap
- 一款能够提高工作效率的小软件
- 使用mybatis完成高级查询(多条件查询)的核心代码
- 新闻摄影后期准则
- [C#].NET中的三种Timer的区别和用法
- 【hibernate错误】An association from the table refers to an unmapped class
- 服务器配置(测试服务器)
- 详解Linux安装GCC方法(下载、解压缩、安装、卸载)
- Material Design:矢量图
- 基本的sqlalchemy映射列类型.配置选项和关系选项
- 美团CODEM 复赛 城市网络 询问离线,树上LCA
- 全面剖析Rxjava2.0的前世今生
- (欧几里得算法)判断互质数的方法 (1130)
- win7/win10 打不开jar文件的2个解决方法