org.hibernate.hql.ast.QuerySyntaxException: tb_voteoption is not mapped [from tb_voteoption where voteID=?]
转自:https://www.cnblogs.com/albert1017/archive/2012/08/25/2656873.html
org.hibernate.hql.ast.QuerySyntaxException: tb_voteoption is not mapped [from tb_voteoption where voteID=?]
解决方案:
这一般是HQL语句错误
因为Hibernate是对类查询的 ,而不是对数据库表进行查询
例如:
return getHibernateTemplate().find("from organization o where o.parent.id=?", new Integer(parentId));
organization 是数据库中的表,而organization 对应的类是Organization.java,现在只需要将teachers改为Teachers就可以了,即
我们将 "from organization o where o.parent.id=?" 改成
"from Organization o where o.parent.id=?"就ok了
org.hibernate.hql.ast.QuerySyntaxException: tb_voteoption is not mapped [from tb_voteoption where voteID=?]的更多相关文章
- SSH执行hql报错:Caused by: org.hibernate.hql.ast.QuerySyntaxException: user is not mapped [from user where username = ?]
报错信息: ERROR Dispatcher:38 - Exception occurred during processing request: user is not mapped [from u ...
- org.hibernate.hql.ast.QuerySyntaxException: Student is not mapped [from Student as stu where stu.sclass=?]
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: t_aty_disease is not ...
- org.hibernate.hql.ast.QuerySyntaxException: XXX is not mapped
因为 String sql2 = "select s from Student s where s.clazz.name=:name"; 此处的 Student 应该为类名.hql ...
- SSH整合报错:org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped[......]
非常诡异的报错,信息如下:org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped [select count(* ...
- org.hibernate.hql.internal.ast.QuerySyntaxException: XXX is not mapped
异常情况: 最近在把一个项目拆分多个 module 的时候数据库查询遇到这个异常:org.hibernate.hql.internal.ast.QuerySyntaxException: Identi ...
- 继承映射中的java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: person is not mapped [FROM person]
继承映射中查询对象的过程中报错: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxExcep ...
- java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: student is not mapped
Spring 5.0 +Jpa,使用@Query实现 自定义查询报错: java.lang.IllegalArgumentException: org.hibernate.hql.internal.a ...
- Spring Data JPA开发中遇到的问题1:org.hibernate.hql.internal.ast.QuerySyntaxException: DispatchShift is not mapped
org.hibernate.hql.internal.ast.QuerySyntaxException: T_D_SHIFT_DISPATCH is not mapped 错误原因: 没有映射到表,经 ...
- weblogic10异常:org.hibernate.hql.ast.HqlToken
转自:http://www.programgo.com/article/68682994452/ 在做查询的时候,报出 org.hibernate.QueryException: ClassNotF ...
随机推荐
- webpack配置反向代理
devServer: { contentBase: path.resolve(__dirname, "../dev"), compress: true, port: ,//本身的端 ...
- Spring read-only="true" 只读事务的一些概念
概念:从这一点设置的时间点开始(时间点a)到这个事务结束的过程中,其他事务所提交的数据,该事务将看不见!(查询中不会出现别人在时间点a之后提交的数据) 应用场合: 如果你一次执行单条查询语句,则没有必 ...
- Nginx与Lua开发
1.Lua及基础语法 Nginx与Lua环境 场景:用Nginx结合Lua实现代码的灰度发布 1.Lua 是一个简洁.轻量.可扩展的脚本语言 2.Nginx+Lua优势 充分的结合Nginx的并发处理 ...
- linux-解决添加的网卡无法识别的问题
添加网卡之后,网卡无法被正确的识别和使用排错方法 查看/etc/udev/rules.d/70-persistent-net.rules的内容,该文件中可以查看到新添加的网卡的MAC地址 修改/etc ...
- bootstrap select下拉框模糊搜索和动态绑定数据解决方法
此方法适合后台一次性返回所有数据好了废话不多说直接上代码: <!DOCTYPE html><html><head> <title>Bootstrap-s ...
- android 文件读写工具类
将可以序列化的对象通过base64编码后进行保存 但是感觉多数情况下,不需要采用这个功能,直接保存原始的json字符串,取出来之后再进行解析即可 package com.wotlab.home.mon ...
- 含有对象的List集合实现字母数字混合排序
List<PageData> varList = [{BOMCode=10A, mantotal=4}, {BOMCode=10B, mantotal=1}, {BOMCode=11A, ...
- Linux函数的使用方法
[root@a ~]#cat fun.txt #定义函数库文件,方便在别的地方使用 addnum1() { echo $[$1+$2] } addnum2(){ echo $[$1*$2] } del ...
- Python分析《武林外传》 -----转载
转载原链接:http://www.cnblogs.com/fredkeke/p/8328387.html 我一向比较喜欢看武侠电影.小说,但是06年武林外传开播的时候并没有追剧,简单扫几眼之后发现他们 ...
- original和source的区别
最近跟网页翻译怼上了,在给翻译前的页面起名是纠结于使用original page还是source page,就查了一下original和source的区别. original: n. 原件:原作:原物 ...