File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes How to call a db function from hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "How to call a db function from hibernate" Watch "How to call a db function from hibernate" New topic
Author

How to call a db function from hibernate

Viswanath Sriram
Greenhorn

Joined: Jul 20, 2006
Posts: 12
Hi,
Can any one tell me how to call the database function from hibernate.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16622

Yes, you can used what is called a Named QUery, where in an xml file you create the call to the stored procedure, you will include ? to allow you to pass in the parameters.

Here is one big caveat.

There can only be one out parameter and it must be the first parameter.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: How to call a db function from hibernate
 
Threads others viewed
Calling DLL function
jsp and javascript
To call a function
Convert Hibernate hbm.xml file (or existing database) to JPA annotated classes
calling a servlet from javascript function??
IntelliJ Java IDE