An IIdentifierGenerator that indicates to the ISession that identity (ie. identity/autoincrement column) key generation should be used.

Namespace: NHibernate.Id
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public class IdentityGenerator : AbstractPostInsertGenerator
Visual Basic
Public Class IdentityGenerator _
	Inherits AbstractPostInsertGenerator
Visual C++
public ref class IdentityGenerator : public AbstractPostInsertGenerator

Remarks

This id generation strategy is specified in the mapping file as

CopyC#
<generator class="identity" />
or if the database natively supports identity columns
CopyC#
<generator class="native" />

This indicates to NHibernate that the database generates the id when the entity is inserted.

Inheritance Hierarchy

System..::..Object
  NHibernate.Id..::..AbstractPostInsertGenerator
    NHibernate.Id..::..IdentityGenerator

See Also