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 ...
随机推荐
- [洛谷2257]YY的GCD 题解
整理题目转化为数学语言 题目要我们求: \[\sum_{i=1}^n\sum_{i=1}^m[gcd(i,j)=p]\] 其中 \[p\in\text{质数集合}\] 这样表示显然不是很好,所以我们需 ...
- SetwindowText 之线程阻塞
示意代码: CriticalSection g_Section; CDialog g_Dlg; // 工作线程函数UINT TreadFunc_A(PVOID para){ Sleep(10); g_ ...
- Linux一些最基础操作
最后更新时间: 2015-05-06 这是一篇很早之前写的,整理笔记的时候看到了,Linux 非常基础操作. bin/sbin: 一般是存放可以执行文件 绝对路径 相对路径 mkdir dir ls: ...
- [CSP-S模拟测试]:购物(柯朵莉树)
题目描述 $visit_world$有一个商店,商店里卖$N$个商品,第$i$个的价格为$a[i]$我们称一个正整数$K$是美妙的,当且仅当我们可以在商店里选购若干个商品,使得价格之和落在区间$[K, ...
- [CSP-S模拟测试]:简单的序列(DP)
题目描述 从前有个括号序列$s$,满足$|s|=m$.你需要统计括号序列对$(p,q)$的数量. 其中$(p,q)$满足$|p|+|s|+|q|=n$,且$p+s+q$是一个合法的括号序列. 输入格式 ...
- Spring、Hibernate、Struts官方下载地址
hibernate 官网: http://hibernate.org/ hibernate3 官方下载:http://sourceforge.net/projects/hibernate/files/ ...
- twitter api的使用
1.用手机号注册推特账号 https://twitter.com/ 2.进入网站 https://apps.twitter.com/ 创建第一个app,填入基本信息 name写完会检测是否已经存在像我 ...
- MySQL Schedule Event
建立事件历史日志表-- 用于查看事件执行时间等信息create table t_event_history ( dbname varchar(128) not null default ' ...
- (转)mnist.load_data()出现错误
解决方法:本地导入1.下载mnist.npz文件mnist.npz链接imdb.npz链接2.将上述文件放于合适位置(执行keras程序的python环境中),因为我用的是python虚拟环境,所以我 ...
- 北风设计模式课程---开放封闭原则(Open Closed Principle)
北风设计模式课程---开放封闭原则(Open Closed Principle) 一.总结 一句话总结: 抽象是开放封闭原则的关键. 1."所有的成员变量都应该设置为私有(Private)& ...