An IIdentifierGenerator that returns an Int64, constructed using a hi/lo algorithm.

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

Syntax

Visual Basic (Declaration)
Public Class TableHiLoGenerator _
	Inherits TableGenerator
C#
public class TableHiLoGenerator : TableGenerator
Visual C++
public ref class TableHiLoGenerator : public TableGenerator
JavaScript
NHibernate.Id.TableHiLoGenerator = function();

Type.createClass(
	'NHibernate.Id.TableHiLoGenerator',
	NHibernate.Id.TableGenerator);

Remarks

This id generation strategy is specified in the mapping file as

 Copy Code
            <generator class="hilo">
            	<param name="table">table</param>
            	<param name="column">id_column</param>
            	<param name="max_lo">max_lo_value</param>
            	<param name="schema">db_schema</param>
            </generator>
            

The table and column parameters are required, the max_lo and schema are optional.

The hi value MUST be fecthed 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. In that case a SequenceHiLoGenerator would be a better choice (where supported).

Inheritance Hierarchy

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

See Also