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

  • SEARCH
  • Home
  • 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 6614501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:20:47+00:00 2026-05-25T20:20:47+00:00

In NHibernate 1.2 is it possible to have the ID generated by a database

  • 0

In NHibernate 1.2 is it possible to have the ID generated by a database trigger? Basically we need to change one of our tables to stop using a sequence and instead use a trigger to generate the primary key. So obviously I need to update the nhibernate mapping to use a different generator class but I’m not sure what class I should use, or even if this is supported in 1.2. Any help would be greatly appreciated. Thanks!

  • 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-25T20:20:48+00:00Added an answer on May 25, 2026 at 8:20 pm

    NHibernate allows you to do this but only starting from 2.1.0:

    trigger-identity

    The “trigger-identity” is a NHibernate specific feature where the POID
    is generated by the RDBMS at the INSERT query trough a BEFORE INSERT
    trigger. In this case you can use any supported type, including custom
    type, with the limitation of “single-column” (so far)…

    select

    The “select” generator is a deviation of the “trigger-identity”. This
    generator work together with natural-id feature. The difference
    “trigger-identity” is that the POID value is retrieved by a SELECT
    using the natural-id fields as filter…

    If you don’t want to upgrade to later versions of NHibernate (because of .NET 1.1?) then you can try Ayende’s custom dialect solution or extend NHibernate as suggested here.

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

Sidebar

Related Questions

I have a case where one of the columns on the database is generated
We create the database using the schemaExport class of nHibernate. I now have an
Is it possible to perform a global reversed-find on NHibernate-managed objects? Specifically, I have
Is it possible to configure nHibernate to connect to Paradox database ( *.db files)?
Using NHibernate, is it possible to fill an existing object using the results of
Is it possible to map an enum as a string using Fluent Nhibernate?
I have a question about joins in NHIBERNATE. We had an issue with our
I am using Fluent-NHibernate (with automapping) to generate my tables but would like to
I have a view joining 3 tables together in a chain that i need
I'm working on a RoleProvider in .NET, using Fluent NHibernate to map tables in

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.