• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks
Siegfried
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
http://www.mkyong.com/hibernate/how-to-call-store-procedure-in-hibernate/
http://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/querysql.html#sp_query
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic