Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are all the NHibernate HiLo generator params?

I've seen some docs by Fabio Maulo that shows the following params:

<id name="Id" type="Int64" column="cat_id">
    <generator class="hilo">
            <param name="table">hi_value</param>
            <param name="column">next_value</param>
            <param name="max_lo">100</param>
    </generator>
</id>

However, on this question the poster uses a <param name="schema">... I'd like to be able to specify schema for the HiLo generator.

Is there definitive documentation for all generator parameters? I've tried googling it without success.

like image 390
Mike Scott Avatar asked Oct 15 '10 13:10

Mike Scott


2 Answers

Another param to throw in the mix is

<param name="where">TableName='CmsLogin'</param>

This gives you the ability to have different counters per entity rather than a counter for all entities.

However I have not seen a way to specify the schema as a param so I think you need to go with creating a separate HiLo Key table for each unique schema in the database.

like image 146
Rippo Avatar answered Nov 13 '22 19:11

Rippo


According to the source, the full list is: "table", "column", "max_lo", "schema", "catalog" and "where", but I don't know if they are all being used. These are defined in classes NHibernate.Id.TableGenerator and NHibernate.Id.TableHiLoGenerator .

like image 43
Ricardo Peres Avatar answered Nov 13 '22 21:11

Ricardo Peres