Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL for my SQL query

 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SQL query : Select * from Lidl_Round lidlRound where 1=1 and lidlRound.lrd_id in (select lrd_id from Lidl_Round_Distr where dbr_id in
(select dbr_id from distributor where first_name like '%LOUISE%'))


HQL query:Select lidlRound from LidlRound lidlRound , LidlRoundDistr lidlRoundDistr where 1=1
and lidlRound =all elements (select lidlRoundDistr.lidlRound from lidlRoundDistr where lidlRoundDistr.distributor.firstName like '%LOUISE%')


Can anyone check whats wrong in the above HQL query?


Getting this :

11:53:18,827 FATAL [application] javax.ejb.EJBTransactionRolledbackException: org.hibernate.hql.ast.QuerySyntaxException: expecting CLOSE, found 'lidl
RoundDistr' near line 1, column 198 [Select lidlRound from uk.co.tntpost.umbrella.common.entity.LidlRound lidlRound , uk.co.tntpost.umbrella.common.en
tity.LidlRoundDistr lidlRoundDistr where 1=1 and lidlRound =all elements (select lidlRoundDistr.lidlRound from lidlRoundDistr where lidlRoundDistr.
distributor.firstName '%LOUISE%')]
javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: org.hibernate.hql.ast.QuerySyntaxException: expecting CLOSE, found 'l
idlRoundDistr' near line 1, column 198 [Select lidlRound from uk.co.tntpost.umbrella.common.entity.LidlRound lidlRound , uk.co.tntpost.umbrella.common
.entity.LidlRoundDistr lidlRoundDistr where 1=1 and lidlRound =all elements (select lidlRoundDistr.lidlRound from lidlRoundDistr where lidlRoundDis
tr.distributor.firstName '%LOUISE%')]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic