Namespaces

Types in FluentNHibernate.Conventions.Instances

Type IGeneratorInstance

Namespace FluentNHibernate.Conventions.Instances

Interfaces IGeneratorInspector

Methods

Public instance methods

void Assigned()

lets the application to assign an identifier to the object before Save() is called.

void Assigned(Action<ParamBuilder> paramValues)

lets the application to assign an identifier to the object before Save() is called.
Parameters
Action<ParamBuilder> paramValues

Params configuration

void Custom(Type generator)

void Custom(string generator, Action<ParamBuilder> paramValues)

void Custom(Type generator, Action<ParamBuilder> paramValues)

void Custom<T>()

void Custom<T>(Action<ParamBuilder> paramValues)

void Foreign(string property)

uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association.

void Foreign(string property, Action<ParamBuilder> paramValues)

uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association.
Parameters
string property
Action<ParamBuilder> paramValues

Params configuration

void Guid(Action<ParamBuilder> paramValues)

uses a new System.Guid as the identifier.
Parameters
Action<ParamBuilder> paramValues

Params configuration

void Guid()

uses a new System.Guid as the identifier.

void GuidComb(Action<ParamBuilder> paramValues)

Recommended for Guid identifiers! uses the algorithm to generate a new System.Guid described by Jimmy Nilsson in the article http://www.informit.com/articles/article.asp?p=25862.
Parameters
Action<ParamBuilder> paramValues

Params configuration

void GuidComb()

Recommended for Guid identifiers! uses the algorithm to generate a new System.Guid described by Jimmy Nilsson in the article http://www.informit.com/articles/article.asp?p=25862.

void HiLo(string talbe, string column, string maxLo)

uses a hi/lo algorithm to efficiently generate identifiers of any integral type, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with a user-supplied connection. requires a "special" database table to hold the next available "hi" value

void HiLo(string maxLo, Action<ParamBuilder> paramValues)

uses a hi/lo algorithm to efficiently generate identifiers of any integral type, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with a user-supplied connection. requires a "special" database table to hold the next available "hi" value
Parameters
string maxLo
Action<ParamBuilder> paramValues

Params configuration

void HiLo(string maxLo)

uses a hi/lo algorithm to efficiently generate identifiers of any integral type, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with a user-supplied connection. requires a "special" database table to hold the next available "hi" value

void HiLo(string talbe, string column, string maxLo, Action<ParamBuilder> paramValues)

uses a hi/lo algorithm to efficiently generate identifiers of any integral type, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with a user-supplied connection. requires a "special" database table to hold the next available "hi" value
Parameters
string talbe
string column
string maxLo
Action<ParamBuilder> paramValues

Params configuration

void Identity(Action<ParamBuilder> paramValue)

supports identity columns in DB2, MySQL, MS SQL Server and Sybase. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.

void Identity()

supports identity columns in DB2, MySQL, MS SQL Server and Sybase. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.

void Increment(Action<ParamBuilder> paramValue)

generates identifiers of any integral type that are unique only when no other process is inserting data into the same table. Do not use in a cluster.

void Increment()

generates identifiers of any integral type that are unique only when no other process is inserting data into the same table. Do not use in a cluster.

void Native(Action<ParamBuilder> paramValues)

picks identity, sequence or hilo depending upon the capabilities of the underlying database.
Parameters
Action<ParamBuilder> paramValues

Params configuration

void Native()

picks identity, sequence or hilo depending upon the capabilities of the underlying database.

void SeqHiLo(string sequence, string maxLo, Action<ParamBuilder> paramValues)

uses an Oracle-style sequence (where supported)
Parameters
string sequence
string maxLo
Action<ParamBuilder> paramValues

Params configuration

void SeqHiLo(string sequence, string maxLo)

uses an Oracle-style sequence (where supported)

void Sequence(string sequenceName)

uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.

void Sequence(string sequenceName, Action<ParamBuilder> paramValues)

uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.
Parameters
string sequenceName
Action<ParamBuilder> paramValues

Params configuration

void UuidHex(string format, Action<ParamBuilder> paramValues)

uses System.Guid and its ToString(string format) method to generate identifiers of type string. The length of the string returned depends on the configured format.
Parameters
string format

http://msdn.microsoft.com/en-us/library/97af8hh4.aspx

Action<ParamBuilder> paramValues

Params configuration

void UuidHex(string format)

uses System.Guid and its ToString(string format) method to generate identifiers of type string. The length of the string returned depends on the configured format.
Parameters
string format

http://msdn.microsoft.com/en-us/library/97af8hh4.aspx

void UuidString(Action<ParamBuilder> paramValues)

uses a new System.Guid to create a byte[] that is converted to a string.
Parameters
Action<ParamBuilder> paramValues

Params configuration

void UuidString()

uses a new System.Guid to create a byte[] that is converted to a string.