org.hibernate.hql.ast.QuerySyntaxException: 求下各位大侠帮忙看看~org.hibernate.hql.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [select * from example.User] at org.hibernate.hql.ast.QuerySyntaxException.convert(QueryS

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/14 06:58:34

org.hibernate.hql.ast.QuerySyntaxException: 求下各位大侠帮忙看看~org.hibernate.hql.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [select * from example.User] at org.hibernate.hql.ast.QuerySyntaxException.convert(QueryS
org.hibernate.hql.ast.QuerySyntaxException: 求下各位大侠帮忙看看~
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [select * from example.User
]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(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)

org.hibernate.hql.ast.QuerySyntaxException: 求下各位大侠帮忙看看~org.hibernate.hql.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [select * from example.User] at org.hibernate.hql.ast.QuerySyntaxException.convert(QueryS
把select * from example.User
换成 from example.User或者 from User就可以了 你用的是SQL语句,而Hibernate 要的是HQL语句