-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Please Help! - Stored Procedure inside HQL query?
PostPosted: Thu Mar 15, 2012 9:47 pm 
Newbie

Joined: Mon Mar 05, 2012 1:49 am
Posts: 7
Hellow guys,

I have no Idea on how to do this in HQL
let's say in SQL I have this query :
Code:
select getClientName(entityId) from tblEntity   

where in getClientName is a stored procedure.


So, how do I do that in HQL?

Can we combine HQL query and stored procedure from native sql? I dont think it's possible.

Or so, can I create stored procedure in HQL and call it in my hibernate query?

So far what I'm doing is I just create a sub query so I can get the result in HQL:

this is my code for HQL :
Code:
select (select b.entityName from tblName b where b.entityId = a.entityId) from tblEntity a 

But what I wanted to do is to create a stored procedure in hql to replace the sub query I used.
Is it possible?

I would appreciate any help!


Top
 Profile  
 
 Post subject: Re: Please Help! - Stored Procedure inside HQL query?
PostPosted: Fri Mar 16, 2012 10:22 pm 
Newbie

Joined: Mon Mar 05, 2012 1:49 am
Posts: 7
Just want to up this guys! thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.