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 8874159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:38:53+00:00 2026-06-14T18:38:53+00:00

I use Fluent NHibernate and I need to use GeneratedBy.Native() for Id generation to

  • 0

I use Fluent NHibernate and I need to use GeneratedBy.Native() for Id generation to support Oracle,DB2 and MSSQL databases. If I try to run it like this on Oracle and insert new record to the table I get:

Could not execute query: select hibernate_sequence.nextval from dual
System.Data.OracleClient.OracleException (0x80131938): ORA-02289: sequence does not exist

Mapping class:

public sealed class ListDataMap : ClassMap<ListData>
{
    public ListDataMap()
    {
        Table("LIST_DEF");

        Id(x => x.Id, "ID").Not.Nullable().GeneratedBy.Native();
        //other mapping
    }
}

How can I specify the name of the sequence? I don’t want to use hibernate_sequence because I will need more than 1 sequence and I don’t want to have 1 shared sequence.

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-06-14T18:38:54+00:00Added an answer on June 14, 2026 at 6:38 pm

    I have found the answer here: http://thatextramile.be/blog/2007/07/native-id-generation-with-nhibernate/

    It is simple as this:

    Id(x => x.Id, "ID").Not.Nullable().GeneratedBy.Native(
        builder => builder.AddParam("sequence", "SEQ_LIST_DEF")
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to use something like this wrapper with fluent configuration? http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/ If
Question follows on from Fluent NHibernate + multiple databases (no need to follow this
In order to use my Fluent NHibernate mappings on SQL Azure, I need to
I need to use Fluent-nHibernate against a table with a composite primary key (Azure
I'm extending Fluent NHibernate for better use with F# (namely, quotation support), and want
Is it possible to use Fluent NHibernate's PersistenceSpecification to test NHibernate mappings done via
I am new to nHibernate. I understand how to use mapping using Fluent nHibernate.
How would I use nHibernate,configured by fluent nhibernate if it makes any difference, to
I've been trying to use #harp architecture and Fluent-NHibernate. I am trying to sublass
Can I use Fluent NHibernate API for .NET 2.0 applications.

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.