报错:table is not mapped……
来源:互联网 发布:万科金域名城业主论坛 编辑:程序博客网 时间:2024/06/11 10:58
使用HQL语句查询表中信息的时候,报错:
最后找到的解决方法是,保持表名跟实体类的名字一致。
具体原因
请求Hibernate类对象的时候错当表名当作对象名。在这里就是把tb_subject当作Subject去实例化一个Hibernate的持久类。代码中是没有tb_subject.java的,所以报错。
总结:Hibernate配置中经常会把表名和Hibernate持久类对象名相混淆。
比如下面的例子,User写成user就会报 user is not mapped 。
List<User> result =(List<User>) session.createQuery("from User").list();
0 0
- 报错:table is not mapped……
- 关于Hibernate报错 “table” is not mapped
- table is not mapped
- table is not mapped
- table is not mapped
- hibernate3报错 XXX is not mapped
- "table" is not mapped 解决方法
- "table" is not mapped 解决方法
- Hibernate报错(user is not mapped)
- org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped
- table not mapped [
- Hibernate报错“usinfo is not mapped”的解决原因及方法
- org.hibernate.hql.internal.ast.QuerySyntaxException: USER is not mapped 报错解决
- Hibernate查询报错:org.hibernate.hql.internal.ast.QuerySyntaxException: XXX is not mapped
- SSH整合报错:org.hibernate.hql.ast.QuerySyntaxException: userinfo is not mapped [from userinfo]
- hibernate报a is not mapped[from a]
- Hibernate Is Not Mapped
- is not mapped 问题
- BMP文件的读取和保存
- Android AsyncTask详解
- html及css复习总结
- 关于打分去掉最高分和最低分的代码
- 两点经纬度求曲面距离
- 报错:table is not mapped……
- Ubuntu 升级后版本号还是显示旧版本号问题解决方法
- HDOJ 1003 Max Sum C++
- 宏定义
- 第十周项目2-二叉树遍历的递归算法
- CodeBlocks调试功能快捷教程
- 泡泡背景
- block,inline和inline-block概念和区别
- <HTML5秘籍>——第7章(CSS3与响应式Web设计)