org.hibernate.hql.internal.ast.Q…
来源:互联网 发布:软件架构 豆瓣 编辑:程序博客网 时间:2024/05/17 06:45
Exception in thread "main"org.hibernate.hql.internal.ast.QuerySyntaxException:StudentEntity2 is not mapped [fromStudentEntity2]
atorg.hibernate.hql.internal.ast.QuerySyntaxException.generateQueryException(QuerySyntaxException.
atorg.hibernate.QueryException.wrapWithQueryString(QueryException.
atorg.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.
atorg.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.
atorg.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.
atorg.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.
atorg.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.
atorg.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.
atorg.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.
atorg.hibernate.internal.SessionImpl.createQuery(SessionImpl.
atMainClass.main(MainClass.
关键部分的代码如下:
String sql ="from student_tbl";
Query que =session.createQuery(sql);
List<StudentEntity>msgs = que.list();
msgs.forEach((s)->{
});
正是因为Hibernate已经把SQL映射成了面向对象的形式,所以即使真正存在于MySQL数据库里面的表名叫student_tbl,也不能直接“fromstudent_tbl”而要通过类名来select——即,这种形式:
0 0
- org.hibernate.hql.internal.ast.Q…
- org.hibernate.hql.internal.ast.ErrorCounter reportError
- org.hibernate.hql.internal.ast.ErrorCounter reportError
- org.hibernate.hql.internal.ast.QuerySyntaxException
- org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.internal.ast.HqlTok
- Hibernate的org.hibernate.hql.internal.ast.tree.PathNode异常
- 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
- org.hibernate.hql.internal.ast.QuerySyntaxException: FwbzItem is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: users is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: ### is not mapped
- org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree []
- org.hibernate.hql.internal.ast.QuerySyntaxException其中一种的解决方案
- weblogic org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.internal.ast.HqlTok
- weblogic org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.internal.ast.HqlTok
- org.hibernate.hql.ast.QuerySyntaxException
- org.hibernate.hql.ast.QuerySyntaxException
- Hexo+Github 博客搭建
- 用JavaSE简单入门MyBatis连接MySQL…
- iOS开发之再探多线程编程:Grand Central Dispatch详解
- hive hql 语句
- MyBatis与Hibernate图文对比
- org.hibernate.hql.internal.ast.Q…
- Linux中shell编程需要避免的坑之shell语法篇(一)
- Fragment中startActivityForResult,并在Fragment中接收返回结果
- MyBatis与Hibernate更改schema的方…
- Spring中AOP,一个query与check的…
- Spring中bean内属性的说明与设置
- org.springframework.beans.factor…
- mac终端命令大全
- JAVA实现不定长度二维数组的转置