• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help in converting sql to hql

 
kishore skipper
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

i have been trying to convert this query into hql but failed. i could not find any help on hibernate.org
Can somebody help me out converting this query?

select i1.items
join plan p
join items i1
on i1.item_id = p.plan_id
join items i2
on i2.grade = i1.grade
and i2.vendor = i1.vendor
group by i1.vendor, i1.grade, i1.item_id

Thanks in advance
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not working SQL. So it is impossible to create HQL on it.

You don't have a FROM clause, and it is a little confusing to see what results you want and what are the joining tables.

Can you repost cleaner SQL?

Thanks

Mark
 
kishore skipper
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry here is the right query

select i1.items
from plan p
join items i1
on i1.item_id = p.plan_id
join items i2
on i2.grade = i1.grade
and i2.vendor = i1.vendor
group by i1.vendor, i1.grade, i1.item_id
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic