expecting IDENT错误解决办法
(2010-11-09 16:16:41) 标签: it | 分类: ThinkInJava |
今天的开发爆出如下错误。
org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '*' near line 1, column 10 [select a.* from com.jyzq.hr.bean.Archive a,com.jyzq.hr.bean.Employee e,com.jyzq.hr.bean.Department d where a.contractEndDate = :date and a.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 where a.contractEndDate = :date and a.status = 'A' and a.empId = e.id and e.status = 'A' and e.type = 'A'
把hql改为如下形式,则编译通过。一切正常
select a from Archive a,Employee e,Department d where a.contractEndDate = :date and a.status = 'A' and a.empId = e.id and e.status = 'A' and e.type = 'A'
select 后面为对象 a .而非 a.*