Hibernate HQL使用inner语句出错
最近开发中使用HQL查询时用到了inner join
hql.append(" select count(*) from DbCourse d ");hql.append(" inner join DbCourseHistory h on h.courseId.id = d.id and h.empId.empId = '"+ab.getAdminID()+"' and h.state.codeId='LEARNING_STATE_FINISHED' ");hql.append(" where d.flag = '"+flag+"' ");但始终报以下异常StringBuilder hql = new StringBuilder();hql.append(" select count(*) from DbCourse d,DbCourseHistory h ");hql.append(" where h.courseId.id = d.id and h.empId.empId = '"+ab.getAdminID()+"' and h.state.codeId='LEARNING_STATE_FINISHED' ");hql.append(" and d.flag = '"+flag+"' ");