Hibernate 中出现 xxx表 is not mapped xxx的问题
来源:互联网 发布:写作的软件 编辑:程序博客网 时间:2024/06/05 19:21
遇到这个问题,只能说是没有好好理解Hibernate。当我们执行如下语句的时候
public int findCount() {String hql = "select count(*) from Room" ;List<Long> list = (List<Long>)this.getHibernateTemplate().find(hql);if(list.size() > 0){ return list.get(0).intValue() ;} return 0;}
可能出现的原因:
1.请务必要注意,在“select count(*) from Room”的时候,这个Room,不是你的数据库对应的表名,也不是你的映射文件的表名。而是你的实体对象的名称(是区分大小写的!)。
2.配置文件没有加载到hibernate的实体类列表里面。
3.映射文件的字段与数据库字段不一致,或者名称不一致。
遇到这个问题的同学可以分别检查一下上面提到的三部分有没有正确。
阅读全文
1 0
- Hibernate 中出现 xxx表 is not mapped xxx的问题
- hibernate:XXX is not mapped问题
- hibernate:XXX is not mapped问题的解决
- hibernate XXX is not mapped
- hql语句出现XXX is not mapped XXX
- JPA无法扫描jar包中Entity的问题,Xxx is not Mapped
- hibernate xxx is not mapped 错误原因及解决方法
- hibernate错误 xx is not mapped [from xxx]
- 关于在SSH框架整合时,使用hql语句查询出现 XXX is not mapped 的问题
- Hibernate 中出现 users is not mapped 问题
- Hibernate 中出现 XXXX is not mapped 问题
- SSH框架中hibernate 出现 user is not mapped 问题
- Hibernate 中出现 users is not mapped 问题
- Hibernate 中出现 users is not mapped 问题
- Hibernate 中出现 users is not mapped 问题
- SSHE框架中hibernate出现user is not mapped问题
- Hibernate 中出现 GOOD is not mapped 问题
- Hibernate 中出现 XXXX is not mapped 问题
- Android组件化开发实践
- Web应用请求平均时间统计
- Java(2-2)
- 百度编辑器(UEditor)调用上传图片、上传文件等模块,并修改图片、文件的保存路径
- 运维的划分
- Hibernate 中出现 xxx表 is not mapped xxx的问题
- 画图
- leetcode18 4Sum
- 【C#】身份证本地验证
- Struts执行流程
- Session和Cookie的对比
- 回调
- POI实现导出Excel数据工具类
- 腾讯手QQ核心技术-NDK开发语音消息变声功能-动脑学院