Does anyone know if NHibernate supports returning output parameters from stored procedures? I've had a search in the documentation but can't really find anything that confirms either way.
I was facing the same problem. NHibernate does not let you use stored procedures in this manner. But it does allow a way to make calls using the plain old ADO.NET API. Here's an example -
http://refactoringaspnet.blogspot.com/2009/06/how-to-use-legacy-stored-procedures-in.html
I can't officially confirm for you, but as far as I know, not directly. Stored procedure use in NHibernate is very specific to doing standard CRUD.
If you want to grab output paramaters (that are't the standard row count output parameter for INSERT, UPDATE, and DELETE), you could fall back to a different (or the standard) database access tools that give you direct access to SQL and the result set. (Assuming you can get by with bypassing NHibernate's cache. You'll want to make sure you flush NHibernate before you run the query too, etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With