Depending on how you want to use the stored procedures, there are some options.
You can call a stored procedure directly using the session's connection property. Suppose that you have a SP that returns a value:
Code:
System.Data.IDbCommand cmd = session.Connection.CreateCommand();
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandText = "MyStoredProc";
long result = (long)cmd.ExecuteScalar();
You will need to be careful of a stored procedure that modifies data.
If you need to use stored procedures that return data to create objects, consider converting them to user-defined functions. These can then be called using a SQL query, or even by mapping a class to the function:
Code:
<class name="MyFunction" table="MyFunction()" mutable="false">
...
or even with parameters:
Code:
<class name="TypeA" table="MyFunc('A')" mutable="false">
...
</class>
<class name="TypeB" table="MyFunc('B')" mutable="false">
...
</class>
This will only work for immutable classes, as there is no way to update tha data tables with this method.