jQuery in Action, 2nd edition*
The moose likes Object Relational Mapping and the fly likes Is ORM (hibernate, JPA) Effective for calling Stored Procedures? 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 "Is ORM (hibernate, JPA) Effective for calling Stored Procedures?" Watch "Is ORM (hibernate, JPA) Effective for calling Stored Procedures?" New topic

Is ORM (hibernate, JPA) Effective for calling Stored Procedures?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
I've used JPA and hibernate when I had control over the database and could automate the propagation of my changes to my java code to the database. Very cool.
Put let us suppose that I need to use stored procedures for CRUD in my new project. Is ORM (hibernate or JPA) going to be as effective? I've never called stored procedures from java before and the JDBC examples I have seen look extremely tedious. Can an ORM make calling stored procedures easier? Is there some other technology -- should I consider iBatus?

Bill Gorder

Joined: Mar 07, 2010
Posts: 1648

Simplifying calling stored procedures is not a problem ORM's set out to address. You can call stored procedures with an ORM but it tends to be more restrictive then straight JDBC, depending out how complex your SPROC is. I think if your CRUD stuff is going to be all stored procedures I would not choose an ORM.

Anyways here is an example how to with Hibernate, other ORM implementations have similar features.

[How To Ask Questions][Read before you PM me]
Don't get me started about those stupid light bulbs.
subject: Is ORM (hibernate, JPA) Effective for calling Stored Procedures?
Similar Threads
Hibernate and Stored Procedure
Issue calling MYSQL Stored Proc using Hibernate JPA
About Hibernate Support for StoredProcedure
How to execute stored procedure?
EJB3.0 and Stored Procedure