今天的开发爆出如下错误。
org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT,found '*' near line 1, column 10 [select a.* fromcom.jyzq.hr.bean.Archive a,com.jyzq.hr.bean.Employeee,com.jyzq.hr.bean.Department d where a.contractEndDate = :date anda.status = 'A' and a.empId = e.id and e.status = 'A' and e.type ='A' and e.deptid=d.id and d.type='A']
原因是hql语句报错。
hql:select a.* from Archive a,Employee e,Department d wherea.contractEndDate = :date and a.status = 'A' and a.empId = e.id ande.status = 'A' and e.type = 'A'
把hql改为如下形式,则编译通过。一切正常
select a from Archive a,Employee e,Department d wherea.contractEndDate = :date and a.status = 'A' and a.empId = e.id ande.status = 'A' and e.type = 'A'
select 后面为对象 a .而非 a.*