异常积累:org.hibernate.hql.ast.QuerySyntaxError: User is not mapped. [from User where username=?]
来源:互联网 发布:java接口访问频率限制 编辑:程序博客网 时间:2024/05/21 12:47
org.hibernate.hql.ast.QuerySyntaxError: User is not mapped. [from User where username=?]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:196)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:603)
at com.demo.hibernate.dao.UserDAOImpl.select(UserDAOImpl.java:19)
at com.demo.hibernate.service.UserServiceImpl.login(UserServiceImpl.java:21)
at com.demo.hibernate.test.UserServiceTest.testLogin(UserServiceTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: User is not mapped.
at org.hibernate.hql.ast.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:85)
at org.hibernate.hql.ast.FromElementFactory.addFromElement(FromElementFactory.java:77)
at org.hibernate.hql.ast.FromClause.addFromElement(FromClause.java:67)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:217)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2830)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2719)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:513)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:371)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)... 28 more
原因:
hibernate.cfg.xml映射.<mapping resource=""/>的配置
类似原因还可能有: hql是写的是table名,不是POJO对象
hibernate.cfg.xml映射.<mapping resource=""/>的配置
类似原因还可能有: hql是写的是table名,不是POJO对象
转载自:http://www.blogjava.net/GavinMiao/archive/2012/01/19/368735.html
- 异常积累:org.hibernate.hql.ast.QuerySyntaxError: User is not mapped. [from User where username=?]
- Hibernate异常: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User] 异常总结
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User] 异常总结
- org.hibernate.hql.internal.ast.QuerySyntaxException: Admin is not mapped [from Admin where username=
- String整合Hibernate Hql出现user is not mapped [FROM USER WHERE username =? and password=?
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User].
- Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User
- org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
- SSH报错:org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select o from User o where 1=1
- 异常:org.hibernate.hql.ast.QuerySyntaxException: EmpModel is not mapped [from EmpModel where name = ?
- org.hibernate.hql.ast.QuerySyntaxException: events is not mapped [from events where..异常
- Exception occurred during processing request: user is not mapped [from user where username=:username
- Hibernate Hql 查询出现 USER is not mapped [FROM USER WHERE
- Hibernate Hql 查询出现 USER is not mapped [FROM USER WHERE
- org.hibernate.hql.internal.ast.QuerySyntaxException: USER is not mapped 报错解决
- org.hibernate.hql.ast.QuerySyntaxException: Revert is not mapped. [from Revert r where r.articles_id
- org.hibernate.hql.ast.QuerySyntaxException: is not mapped 异常总结
- c++中设计模式----单例模式
- “想赢”和“敢输”
- Mac OS X 下安装Subclipse
- Java中十个常见的违规编码
- HashCode相关类容
- 异常积累:org.hibernate.hql.ast.QuerySyntaxError: User is not mapped. [from User where username=?]
- PHP strip_tags 怎么 保留多个HTML标签
- 【ios】UIScrollView 原理
- lucene学习笔记之Analyzer和Search
- 主题:在Android上实现SSL握手(客户端需要密钥和证书),实现服务器和客户端之间Socket交互
- HDU 2084 数塔
- 《科学研究方法与实践》——张路老师
- debug 为true 导致 executionTimeout 无效
- 赵雅智_java 网络编程(3)之TCP