I have the following hql but getting the exception :
Code:
String shql=" from (from rempim_tb as mpim where mpim.mpim_emp_no =:empno), barcodeentry as bcode where bcode.brcd_part_no between mpim.mpim_part_no_frm and mpim.mpim_part_no_to";
Query query=getSession().createQuery(shql);
query.setParameter("empNo", empNo);
Quote:
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 7 [ from (from rempim_tb as mpim where mpim.mpim_emp_no =:empno), barcodeentry as bcode where bcode.brcd_part_no between mpim.mpim_part_no_frm and mpim.mpim_part_no_to]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:281)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)
Pl tell me where i am wrong.