This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Stored Procedure with Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Stored Procedure with Hibernate" Watch "Stored Procedure with Hibernate" New topic
Author

Stored Procedure with Hibernate

Padma Prasad
Ranch Hand

Joined: Sep 16, 2002
Posts: 76
Does Hibernate provide support for stored procedure? kind of callable statement? I need this to have a query performed over a set of variables and return the result. I dont want to query for each variable. I cannot have a one-many mapping because this is a huge table and i want only few rows n columns of it. so, cannot have this mapping.
Thanks,
Padma.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


i want only few rows n columns of it

Hibernate will let you specify how many rows to return - have a look at the Query object's setMaxResults(int rows) method. Hibernate just picks whatever DB specific piece of proprietory SQL it needs to call to do this.
With regards to SP support, have a look at the Query object's createSQLQuery() method. Of course once you start using SPs, with their propritory syntax you remove Hibernate's DB protablitlity.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stored Procedure with Hibernate
 
Similar Threads
Calling Stored Procedure from Hibernate mapping file
Any sucess using Hibernate, MySQL, and sql-update with stored procedures?
How do I execute a SQL Server Stored Procedure with Hibernate?
Calling a Stored Procedures for Hibernate
How Hibernate invokes Stored Procedures