Siddhardh
asked on
unexpected token
I would like to retrieve count of the rows in ScanPT table.
I wrote this query in Hibernate console and got the result 2.
When i use it in my Java code it throws me ERROR org.hibernate.hql.PARSER - line 1:182: unexpected token: q
Can you tell me what iam doing wrong ?
public int checkForPT(long id) throws Exception{
String sql = "select count(pt) from ScanPT as pt where pt.scanComp.id in " +
"(select tasks.id from Queue as q inner join q.scanCompany as tasks"+
"where q.company.id = ? )";
List pnrCount = getHibernateTemplate().fin d(sql,id);
int result = pnrCount.size();
return result;
}
I wrote this query in Hibernate console and got the result 2.
When i use it in my Java code it throws me ERROR org.hibernate.hql.PARSER - line 1:182: unexpected token: q
Can you tell me what iam doing wrong ?
public int checkForPT(long id) throws Exception{
String sql = "select count(pt) from ScanPT as pt where pt.scanComp.id in " +
"(select tasks.id from Queue as q inner join q.scanCompany as tasks"+
"where q.company.id = ? )";
List pnrCount = getHibernateTemplate().fin
int result = pnrCount.size();
return result;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER