Toast
Toast

Reputation: 657

Are HiLo IDs unique across different tables?

I have two different classes that map to two different database tables. IDs are created by NHibernate using the HiLo generator:

<generator class="hilo">
    <param name="table">uid</param>
    <param name="column">column</param>
</generator>

Are the IDs unique across both tables if I use the same table and column parameters for both mappings? If not, how can I achieve this?

Upvotes: 1

Views: 55

Answers (1)

Radim K&#246;hler
Radim K&#246;hler

Reputation: 123861

NHibernate will distribute unique ids among all these tables, which use the same setting (table and column)

If we want to have different id rows/sets, we can use another param:

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

see more here:

What are all the NHibernate HiLo generator params?

Upvotes: 1

Related Questions