org.hibernate.hql.ast.QuerySyntaxException异常

当出现以下异常信息时
javax.servlet.ServletException: org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: : near line 1, column 33 [from com.dao.Book where bookName:=name]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 33 [from com.dao.Book where bookName:=name]
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)

表示HQL语句写错了,如findByNamedParam("from Book where bookName:=name", "name", bname);应是=:而不是:=

猜你喜欢

转载自lihong11.iteye.com/blog/1431807
今日推荐