NHibernate : NHibernate.Id Namespace

TableHiLoGenerator Class

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

public class TableHiLoGenerator : TableGenerator

Remarks

This id generation strategy is specified in the mapping file as
Example
            <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 NHibernate.Id.SequenceHiLoGenerator would be a better choice (where supported).

Requirements

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

Members

See Also: Inherited members from TableGenerator.

Public Constructors

Documentation for this section has not yet been entered.

Public Fields

const
MaxLo string . The name of the max lo parameter.

Public Methods

override
Configure (NHibernate.Type.IType, IDictionary, NHibernate.Dialect.Dialect)
Configures the TableHiLoGenerator by reading the value of table, column, max_lo, and schema from the parms parameter.
override
Generate (NHibernate.Engine.ISessionImplementor, object) : object
Generate a short, int, or long for the identifier by selecting and updating a value in a table.

Member Details

TableHiLoGenerator Constructor

Documentation for this section has not yet been entered.

public TableHiLoGenerator ()

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Configure Method

Configures the TableHiLoGenerator by reading the value of table, column, max_lo, and schema from the parms parameter.

public override void Configure (NHibernate.Type.IType type, IDictionary parms, NHibernate.Dialect.Dialect dialect)

Parameters

type
The NHibernate.Type.IType the identifier should be.
parms
An IDictionary of Param values that are keyed by parameter name.
dialect
The NHibernate.Dialect.Dialect to help with Configuration.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Generate Method

Generate a short, int, or long for the identifier by selecting and updating a value in a table.

public override object Generate (NHibernate.Engine.ISessionImplementor session, object obj)

Parameters

session
The NHibernate.Engine.ISessionImplementor this id is being generated in.
obj
The entity for which the id is being generated.

Returns

The new identifier as a short, int, or long.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

MaxLo Field

The name of the max lo parameter.

public const string MaxLo

Remarks

Documentation for this section has not yet been entered.

Requirements

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