This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes How to call Stored Procedure in hibernate which doesn't return results from any specific tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to call Stored Procedure in hibernate which doesn Watch "How to call Stored Procedure in hibernate which doesn New topic
Author

How to call Stored Procedure in hibernate which doesn't return results from any specific tables

Niranjan Welankiwar
Greenhorn

Joined: Mar 28, 2012
Posts: 4
Hello All,

I have a stored Procedure which doesn't return result set from any specific tables. Below is the SP :

PROCEDURE [dbo].[spCMTGetClientSummaryRegion]
AS
BEGIN
SELECT 'North East' AS 'Region', '1' AS 'ActiveClients', '3.03%' AS 'Percentage', '1' AS 'Prospects', '3.03%' AS 'TotalPercentage'
END

Output :

Region ActiveClients Percentage Prospects TotalPercentage
North East 1 3.03% 1 3.03%

Now, I want to call this SP from Hibernate and store the result in a java bean object. Below is the hibernate call:

<sql-query name="callCMTGetClientSummaryRegion" callable="true">
<return alias="Client" class="ClientSummaryRegionVO"/>
{call spCMTGetClientSummaryRegion() }
</sql-query>

Where my bean object is ClientSummaryRegionVO. Please help.

Thanks in advance.

Regards,
Niranjan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call Stored Procedure in hibernate which doesn't return results from any specific tables
 
Similar Threads
Newbie needs help with "Object has been closed" exception
How to use storedProcedure in Hibernate 3
Calling Stored Procedure from Hibernate mapping file
How to access Stored Procedure
hibernate and PL/SQL