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 ...
随机推荐
- PHP入门培训教程 PHP变量的使用
很多朋友在编写PHP程序的时候有时候对变量总有着不能确定的问题,而且也有很多问题就是因为变量的处理不当所造成的.这里兄弟连PHP培训 小编,就PHP变量系统说一下. PHP的变量分为全局变量与局部 ...
- ubuntu1804隐藏顶部工作栏
先安装 sudo apt-get install gnome-shell-extension-autohidetopbar 然后安装 sudo apt-get install gnome-shell- ...
- [luogu]P1066 2^k进制数[数学][递推][高精度]
[luogu]P1066 2^k进制数 题目描述 设r是个2^k 进制数,并满足以下条件: (1)r至少是个2位的2^k 进制数. (2)作为2^k 进制数,除最后一位外,r的每一位严格小于它右边相邻 ...
- UVA 540 Team Queue(模拟+队列)
题目代号:UVA 540 题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page ...
- Oracle---智斗ORA01427
下面是我在做更新的时候遇到报ORA-01427,单行子查询返回多行值,原因是红色部分返回了多行值 UPDATE IN_MO IM SET IM.BOM_ID = (S ...
- 笔记本连接树莓派3b(不需要屏幕)
一.网线直连 工具:笔记本,网线,树莓派 软件:putty 过程: 将系统烧录进SD卡后,在root里添加一个名字为“ssh”的空白文件(不需后缀名)来开启ssh服务,SD卡里的cmdline.txt ...
- ES6 模板语法和分隔符
let user = 'Barret'; console.log(`Hi ${user}!`); // Hi Barret!
- React-Native 之 GD (四)使用通知方式隐藏或显示TabBar
1.GDHalfHourHot.js 发送通知 /** * 近半小时热门 */ import React, { Component } from 'react'; import { StyleShe ...
- 网络处理器(Network Processor)
网络处理器(Network Processor,简称NP),又可以称为交换芯片,专用于实现核心交换机高速转发功能. 根据网络处理器会议(Network Processors Conference)的定 ...
- mysql group by 去重 分类 求和
w SELECT COUNT(*) FROM ( SELECT COUNT(*) FROM listing_vary_asins GROUP BY asin, countrycode ) AS w; ...