How do you call a stored procedure with nHibernate?
Specifically there are two cases where I am using store procedures: to return a scalar value and to return a set of results mapped to entities.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The documentation suggests the following for mapping a named query for a stored procedure:
This could be called by using :
This is discussed in section 13.2.2 (mapping stored procedure) and 9.3.2 (querying named query) of the NHibernate 1.2.0 documentation.
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/querysql.html#sp_query