Let the stored procedure be the following (Example)
ALTER PROCEDURE [dbo].[GetStudent]
-- Add the parameters for the stored procedure here
(@Id int)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT * FROM Student WHERE id=@Id;
END
Then add the following code in Students.hbm.xml
Add the following code in program file
IQuery query = session.GetNamedQuery("GetStudent");
query.SetInt32("Id",id );
IList
This way you can use any stored procedure :)
No comments:
Post a Comment