无线&移动互联网技术研发

换位思考·····
posts - 19, comments - 53, trackbacks - 0, articles - 283
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理
from MemberExtendInfo m where m.account ='sinatest'
org.hibernate.hql.ast.QuerySyntaxException: MemberExtendInfo is not mapped [from MemberExtendInfo m where m.account 
='sinatest']
        at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:
158)
        at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:
87)
        at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:
70)
        at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:
255)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:
3056)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:
2945)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:
688)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:
544)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:
281)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:
229)
        at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:
228)
        at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:
160)
        at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:
111)
        at org.hibernate.engine.query.HQLQueryPlan.
<init>(HQLQueryPlan.java:77)
        at org.hibernate.engine.query.HQLQueryPlan.
<init>(HQLQueryPlan.java:56)
        at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:
72)
        at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:
133)
        at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:
112)
        at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:
1623)

网上说的挺多,大多说的是HQL&SQL的区别,说HQL是面向对象的,不能from表名,要用对象名,仔细看了下HQL:from MemberExtendInfo m where m.account ='test',是没有问题的,然后郁闷了一下,想起来了,哈哈,没有配置MemberExtendInfo映射文件到spring容器,配完OK,流水账问题,仅仅记录一下··

只有注册用户登录后才能发表评论。


网站导航: