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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:12:03+00:00 2026-05-27T11:12:03+00:00

I would like to use hilo generator but there is no any complete example

  • 0

I would like to use “hilo” generator but there is no any complete example how to create “specific” table as NH documentation says, and which values pass to it.
The following code fragments taken from NH tutorial

public class Cat
{
    private Int64 id;
    private string name;
    private char sex;
    private float weight;

    public Cat()
    {}

    public virtual Int64 Id
    {
        get { return id; }
        set { id = value; }
    }
    ....
}

Mapper

<hibernate-mapping ...>
<class name="Cat" table="Cat">
  <id name="Id" >
    <column name="CatId" sql-type="Int64" not-null="true"/>
    <generator class="hilo"/>
  </id>
  <property name="Name">
    <column name="Name" length="16" not-null="true" />
  </property>
  ....
</class>
</hibernate-mapping>

DB table “Cat”
CatId bigint NOT NULL
Name varchar(16) NOT NULL
Sex char(1) NULL
Weight real NULL
doesn’t create anything in the database by default.

Parameters in the “id” node

    <param name="table">hi_value</param>
    <param name="column">next_value</param>
    <param name="max_lo">100</param>

gives “Invalid object name ‘hi_value'” error message, without them I’m getting “Invalid object name ‘hibernate_unique_key’.”

Cuid.Comb that is shown in their tutorial works good but gives 99.12% of fragmentation when I added in a loop 20K cat objects.
Can somebody point me to an example of “hilo” implementation or give a tip what I’m missing?

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-27T11:12:04+00:00Added an answer on May 27, 2026 at 11:12 am

    This solution solved my problem. It’s fairly simple, don’t know why on nhibernate site there is no tiny example like that.

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

Sidebar

Related Questions

I would like to use a component that exposes the datasource property, but instead
I would like to use Emacs to edit some VB6 files but Emacs does
I would like to use VB9 but am not sure what syntax to use
Possibly really simple question, but I'm new to IronPython. I would like use IronPython
I would like to use AndEngine's particle system to create a splash(as in splashing
I would like to use the system font but with a custom leading, but
I would like to use prepared statements, for many reasons . But, I would
I would like use .appendTo() on different elements determined by a function. For example,
I would like to use factory classes and methods to generate GUI components, but
I am using AdoNetAppender (SQL server) in my asp.net application and would like use

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.