NHibernate - Identity Column

I announced a Mapping change for NHibernate:

<class name="Sales" table="Sales" lazy="false"  >
    <id name="Id" column="Id" type="Guid">      
                    <generator class="assigned"/>
    </id>
  <version name="ObjectVersion" column="ObjectVersion"/>
    <property name="Number" column="Subject" type="String" length="255"  />
    <property name="Text" column="Body" type="String" length="50" not-null="true"  />
</class>

Now I have to add an additional column Key, which is defined as AutoIncrement-Column. Can someone give me advice on how I should declare this column? This column should not be the main key - I only need an additional column with an integer, which is counted for each record.

Thank you for your help.

Best regards, Thomas

+3
source share
1 answer

SQL Server? , Identity ALTER TABLE Sales ADD Key INTEGER Identity(1,1) . , .

+3

Source: https://habr.com/ru/post/1773140/


All Articles