基础知识的重要
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.recover(Lantlr/RecognitionException;Lantlr/collections/impl/BitSet;)V
?at org.hibernate.hql.antlr.HqlBaseParser.assignment(HqlBaseParser.java:484)
?at org.hibernate.hql.antlr.HqlBaseParser.setClause(HqlBaseParser.java:424)
?at org.hibernate.hql.antlr.HqlBaseParser.updateStatement(HqlBaseParser.java:218)
?at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:142)
?at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:238)
?at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155)
?at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
?at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
?at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
?at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
?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:1583)
?at com.flyinsky.eagle.user.dao.UserDAO.update(UserDAO.java:242)
?at com.flyinsky.eagle.user.test.TestHibernate.main(TestHibernate.java:62)
?
?
用的太多,就以为理所当然,忘了基础知识了。
?
造成错误的原因:
sql拼写错误。
????????? String hql = "update UserInforPO set name =? ,set password=? , set allAddress=?? where id = 1";
正确拼写:
????? String hql = "update UserInforPO set name =? , password=? , allAddress=?? where id = 1";
?
?