views:

505

answers:

1

I'm wondering if there is a way to get SchemaExport to generate and identity column for a generated property.

<id name="Id" column="Id" type="Guid">
  <generator class="guid.comb" />
</id>
<property name="OrderNumber" column="OrderNumber" type="Int32" generated="insert"/>

With the mapping above, ShcemaExport does not make the OrderNumber column an Identity column.

Greg

+1  A: 

I figured it out, with Fabio Maulo's help:

<property name="OrderNumber" generated="insert" update="false">
  <column name ="OrderNumber" sql-type="int identity" not-null="true"/>
</property>
Greg Banister