What are all the NHibernate HiLo generator params?
Asked Answered
G

2

8

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.

Gametocyte answered 15/10, 2010 at 13:54 Comment(0)
I
2

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.

Internship answered 12/1, 2011 at 8:0 Comment(3)
Thanks Rippo, I used that option initially before I realised I could just use a different column for each table.Gametocyte
@MikeScott any chance you can post an example?Eudy
@Ufuk, do you mean an example of using different columns in the hilo table for each table that uses a hilo generator? If so, I think that would be better as a different question as it's not really on topic. Post a question and I'll be happy to answer with a code snippet.Gametocyte
R
1

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 .

Rumilly answered 29/3, 2011 at 17:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.