tags:

views:

78

answers:

1

How can I define identity seed (and also increment) in NHibernate mapping. Here is my class

<class name="MyClass" table="MyClass">
  <id name="Id" type="int" column="ID">
    <generator class="native">
  </id>
...
</class>

Is there something like:

<class name="MyClass" table="MyClass">
  <id name="Id" type="int" column="ID" seed="1000">
    <generator class="native">
  </id>
...
</class>
A: 

Here is where one of the colleagues found the solution: http://weblogs.asp.net/bsimser/archive/2008/10/29/nhibernate-identity-columns-that-are-not-the-primary-key.aspx The answer is int the comment given by Fabio Maulo

vucetica