org.hibernate.MappingException: Could not determine type for: String
来源:互联网 发布:河北天然气 知乎 编辑:程序博客网 时间:2024/05/06 16:31
用Hibernate连接数据库时出现了如下错误:
org.hibernate.MappingException: Could not determine type for: String, at table: animal, for columns: [org.hibernate.mapping.Column(animal_type)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:292)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:307)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at com.guet.orm.dao.AnimalDao.insertAnimals(AnimalDao.java:33)
at com.guet.orm.test.HibernateDaoTest.insertTiger(HibernateDaoTest.java:43)
at com.guet.orm.test.HibernateDaoTest.main(HibernateDaoTest.java:29)
根据错误提示找到对应的配置文件,最终发现错误根源在
<discriminator column="animal_type"type="String"/>。
"String"是java的数据类型,Hibernate中对应的数据类型是"string",在书写hibernate的配置文件时,要么使用"string",要么使用"java.lang.String"。
- org.hibernate.MappingException: Could not determine type for: String
- 【hibernate】org.hibernate.MappingException: Could not determine type for: String, for columns:
- org.hibernate.MappingException: Could not determine type for 错误
- org.hibernate.MappingException: Could not determine type for
- org.hibernate.MappingException: Could not determine type for
- Caused by: org.hibernate.MappingException: Could not determine type for
- org.hibernate.MappingException: Could not determine type for:
- org.hibernate.MappingException: Could not determine type for: String, at table: Elec_Text, for colum
- org.hibernate.MappingException: Could not determine type for: String, at table: Elec_SystemDDL, for
- org.hibernate.MappingException: Could not determine type for: java.lang.string
- org.hibernate.MappingException: Could not determine type for: String 数据类型错误
- Caused by: org.hibernate.MappingException: Could not determine type for: org.cgh.ssh.pojo.GoodsType,
- 使用Hibernate的UserType时报错:org.hibernate.MappingException: Could not determine type for: EMailList, at
- Hibernate异常Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set
- org.hibernate.MappingException: Could not determine type for: java.util.List, at table: user, for...
- org.hibernate.MappingException: Could not determine type for: Integer, at table: grade, for columns
- org.hibernate.MappingException: Could not determine type for: java.util.Set
- 错误提示:Caused by: org.hibernate.MappingException: Could not determine type for
- 单节点RAC无法启动
- MFC 的根--CObject
- 检查SAP各个Client的初始口令
- 新好耶笔试题
- Linux shell开发第一讲
- org.hibernate.MappingException: Could not determine type for: String
- public,protected,private访问
- js ajax跨域js代码
- 一个lucene对数据库表做全文搜索的例子
- Composite(组合)模式
- Java基础知识
- VC++之使用CFile类打开文件
- 自定义 Notification中 布局界面
- 一张图片由A、B两部分组成,当鼠标移动上去时显示B部分,当鼠标移出时显示A部分。