关于hibernate中的错误:Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: tb_e
来源:互联网 发布:淘宝的车秒贷怎么算的 编辑:程序博客网 时间:2024/05/16 02:33
public class TestAnnotation {public static void main(String[] args){Session session = AnnotationSessionFactory.getSession();Query query = session.createQuery("<span style="color:#ff0000;">from tb_employee</span>");List list = query.list();Iterator iter = list.iterator();TbEmployee employee = null;System.out.println("职员编号\t职员姓名\t职员性别\t职员出生日期\t职员手机号码\t职员居住地址\t职员进公司时间");while(iter.hasNext()){employee = (TbEmployee)iter.next();System.out.println(employee.getEmployeeId()+"\t"+employee.getEmployeeName()+"\t"+employee.getEmployeeSex()+"\t"+employee.getEmployeeBirth()+"\t"+employee.getEmployeePhone()+"\t"+employee.getEmployeePlace()+"\t"+employee.getJoinTime());}AnnotationSessionFactory.closeSession();}}我建的数据库表名是tb_employee,执行from tb_employee出现如题错误提示,将tb_employee改为对应的持久化类名:TbEmployee即可!!
0 0
- 关于hibernate中的错误:Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: tb_e
- Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token:
- Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User
- org.hibernate.hql.internal.ast.QuerySyntaxException
- exception is org.hibernate.hql.internal.ast.QuerySyntaxException: Driver is not mapped...的坑
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException:
- org.hibernate.hql.internal.ast.QuerySyntaxException: Exam is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: appUser is not mapped
- [Android进阶]Android中使用的观察者模式
- [安卓开发]快递查询demo|Json解析|条形码扫描|物流布局|历史记录
- 番茄工作法
- 以极地号为例认识科考船上的各种设备
- 2016April Python学习笔记(pandas&echarts)
- 关于hibernate中的错误:Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: tb_e
- web测试
- 跟着郝斌学数据结构(05)——栈
- 安装Windows和Ubuntu双系统
- Linux驱动开发之 七 (不知道目录结构,何谈Linux)
- 高德地图组件在Android的应用以及Android与JavaScript的交互(一)
- java中接口类似c++中纯虚函数
- 各种排序算法的比较——一步一步算法篇
- Retrofit的简单使用