Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 415733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:24:37+00:00 2026-05-12T18:24:37+00:00

How do you call a stored procedure with nHibernate? Specifically there are two cases

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:24:37+00:00Added an answer on May 12, 2026 at 6:24 pm

    The documentation suggests the following for mapping a named query for a stored procedure:

    <sql-query name="selectAllEmployments_SP">
      <return alias="emp" class="Employment">
      <return-property name="employee" column="EMPLOYEE"/>
      <return-property name="employer" column="EMPLOYER"/>
      exec selectAllEmployments   //stored procedure call here
    </sql-query>
    

    This could be called by using :

    IQuery q = sess.GetNamedQuery("selectAllEmployments_SP");
    

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to have NHibernate call a stored procedure when ISession.Get is called to
Using Linq to call a stored procedure that passes a single string, The stored
I am trying to call the stored procedure using subsonic and getting Object Reference
I'm trying to call a stored procedure using ADO .NET and I'm getting the
I need to call some stored procedures via NHibernate (not necessarily for CRUD-operations). Is
I need to call a stored procedure using JPA and found this article: http://www.oracle.com/technology/pub/articles/vasiliev-jpql.html
If I try and call a stored procedure and there is a database error,
I am using ADO.net to call stored procedures to perform insertions into a Sybase
WhenI call this stored procedure: ALTER PROCEDURE [dbo].[GetSorted] ( @OrderByColumn nvarchar(256) ) AS SET
How can we call a stored procedure using Hibernate or JPA?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.