表别名使用hibernate时出现意外的令牌错误

时间:2017-08-11 16:38:43

标签: java spring hibernate

我正在使用Spring hibernate。

我的代码如下:

String hql = "select a.candidate_id_fk, count(*) from Answers a , Question b where a.question_id_fk = b.id"+""
            +"and a.answer=b.correct_answer group by a.candidate_id_fk";

Session session = sessionFactory.getCurrentSession();
List list = session.createQuery(hql).list();
  

错误:   org.hibernate.hql.internal.ast.ErrorCounter reportError    意外的令牌:a

0 个答案:

没有答案