The moose likes Object Relational Mapping and the fly likes Spring hibernate issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Spring hibernate issue" Watch "Spring hibernate issue" New topic

Spring hibernate issue

Bbunty Shinde

Joined: Jun 16, 2010
Posts: 2
I am trying to call stored procedure(in DB2 database) using HibernateTemplate.There are 60 to 70 stored procedure,we are using in our application.I never deal with stored procedure in hibernate.
Kindly tell me what should be my approach with sample example.(with hbm file).
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

You treat stored procedures by mapping them as named queries. There are restrictions; for these and the example you crave see the Hibernate documentation.

One thing to note, for a system with an existing 60-70 stored procedures I would be hesitating to use an ORM. The SPs mean you are tied to this database, which removes one of the key benefits of ORMs (portability).

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Consider Paul's rocket mass heater.
subject: Spring hibernate issue
Similar Threads
Stored Procedure + Hibernate + DB2
Can we make a query to call a stored procedure using JPA and Hibernate as persistance provider
About Hibernate Support for StoredProcedure
Is it a good design model (struts + hibernate)?
Calling a Stored Procedures for Hibernate