Hibernat异常

may 07-04-27

我写了段程序控制台报Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxError: unexpected token: from near line 1, column 8 [select from TopoShowSpec]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
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 com.toposhow.dao.TopshowDao.getAll(TopshowDao.java:74)
at com.toposhow.util.Test.main(Test.java:13)
Caused by: line 1:8: unexpected token: from
at org.hibernate.hql.antlr.HqlBaseParser.selectClause(HqlBaseParser.java:962)
at org.hibernate.hql.antlr.HqlBaseParser.selectFrom(HqlBaseParser.java:735)
at org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:611)
at org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:263)
at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:150)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
... 8 more
那位大虾能帮我看看谢谢!!!

banq
2007-05-08 10:29

不是已经告诉你了:
from near line 1, column 8 [select from TopoShowSpec]
这个SQL语句有问题