[hibernate-dev] Using hiberate with DB2 Stored Procedures
McDowell, Paula
Paula.McDowell at SUG.com
Thu Jun 11 08:43:36 EDT 2009
Hi, all. I'm new to hibernate, and I'm having a hard time finding examples on how to define a mapping for a stored procedure. I'm mainly confused on the "call" portion.
<sql-query name="GETFUNDINGTYPES" callable="true">
<return alias= "getFundingTypes" class="FundingType">
<return-property name="code" column="CODE"/>
<return-property name="description" column="DESCRIPTION"/>
<return-property name="createTS" column="CREATE_TS"/>
</return>
{? = call GETFUNDINGTYPES ()}
</sql-query>
It may sound silly, but I need to understand the relevance of the "?" 's. I'm returning all the columns in the table, so I've listed all three as return properties. (CODE, DESCRIPTION, CREATE_TS)
1. What goes in the method call parens? Is it the number of input/output that the DB2 stored procedure has defined? Or is it the number of return properties, ie GETFUNDINGTYPES(?,?,?); one '?' for each return property listed. Or do I leave it empty as I have done above since I've already listed the return properties?
2. What does the '?' to the left of the '=' mean? Is it the number of actual results? If that is true, then is it always one '?' to signify one result set?
Any help that anyone can provide is greatly appreciated.
Thank you,
Paula
Private and confidential as detailed here: http://www.sug.com/disclaimers/default.htm#Mail . If you cannot access the link, please e-mail sender.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-dev/attachments/20090611/7530d6e9/attachment.html
More information about the hibernate-dev
mailing list