1

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Toast
  • 596
  • 2
  • 19
  • 39

1 Answers1

1

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?

Community
  • 1
  • 1
Radim Köhler
  • 122,561
  • 47
  • 239
  • 335