An IIdentifierGenerator that uses a database table to store the last generated value.

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

Syntax

Visual Basic (Declaration)
Public Class TableGenerator _
	Implements IPersistentIdentifierGenerator, IIdentifierGenerator, IConfigurable
C#
public class TableGenerator : IPersistentIdentifierGenerator, 
	IIdentifierGenerator, IConfigurable
Visual C++
public ref class TableGenerator : IPersistentIdentifierGenerator, 
	IIdentifierGenerator, IConfigurable
JavaScript
NHibernate.Id.TableGenerator = function();

Type.createClass(
	'NHibernate.Id.TableGenerator',
	null,
	NHibernate.Id.IPersistentIdentifierGenerator,
	NHibernate.Id.IIdentifierGenerator,
	NHibernate.Id.IConfigurable);

Remarks

It is not intended that applications use this strategy directly. However, it may be used to build other (efficient) strategies. The return type is System.Int32

The hi value MUST be fetched in a seperate transaction to the ISession transaction so the generator must be able to obtain a new connection and commit it. Hence this implementation may not be used when the user is supplying connections.

The mapping parameters table and column are required.

Inheritance Hierarchy

System..::.Object
  NHibernate.Id..::.TableGenerator
    NHibernate.Id..::.TableHiLoGenerator

See Also