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

how to write hibernate query for complicated oracle query

 
via agarwal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have following oracle query:-

select *
from sb_skill_group join
(select * from vw_sub_campaign_view ) on
(scv_skillgroup_guid = sg_uid)

I want to convert it into hibernate query. Not sure how to do it.
Please help.

Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That query looks clumsy. Why are you using a sub query?

That aside, assuming you have mapped both sb_skill_group and vw_sub_campaign_view your HQL will look pretty much exactly as your SQL does.
 
via agarwal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

I think I made a mistake in writing query. It's like this:-

select *
from sb_skill_group sg Left outer join
(select * from vw_sub_campaign_view
where status in (1,2,3,4)
) sc on
(scv_skillgroup_guid = sg_uid)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic