• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a Stored Procedures for Hibernate

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm looking for a way to call stored procedure with hibernate.

I am Using XDoclet annotations to generate the hibernate configuration and mapping files. How do i generate the meta-data for the stored procedure.

Anyone have any documents, examples, or suggestions on how to do this?

Thanks,
Srikanth.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, you will use Named Queries for the stored procedures.

there are some rules.

1) Only one out parameter allowed and it must be the first parameter.
2) the out parameter must be a ref cursor.

http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html#sp_query

Mark
[ June 04, 2008: Message edited by: Mark Spritzler ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic