在使用hibernate模板的时候,执行的时候出现了一个错误,如下:org.springframework.orm.hibernate3.HibernateQueryException: unexpected char: ‘"’ [select distinct new com.audit.bean.Addparams(r1.ruleKey,r1.ruleKey) from com.audit.bean.RuleEdit r1 where r1.ruleKey =
自己检查了一下写的hql语句好像都没有问题,但是还是报错,最终从错误信息中看到nexpected char: ‘"’ 这时再去检查hql语句的时候,发现自己拼接参数的时候使用了双引号 " ,所以导致出错,hql语句条件参数应该使用单引号,而不是双引号。