C# Class FluentNHibernate.Mapping.IdentityGenerationStrategyBuilder

Datei anzeigen Open project: HudsonAkridge/fluent-nhibernate Class Usage Examples

Public Methods

Method Description
Assigned ( ) : IIdentityPart

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

Foreign ( string property ) : IIdentityPart

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

Guid ( ) : IIdentityPart

uses a new System.Guid as the identifier.

GuidComb ( ) : IIdentityPart

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.

HiLo ( string maxLo ) : IIdentityPart

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

HiLo ( string table, string column, string maxLo ) : IIdentityPart

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

Identity ( ) : IIdentityPart

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.

IdentityGenerationStrategyBuilder ( IIdentityPart parent ) : System
Increment ( ) : IIdentityPart

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.

Native ( ) : IIdentityPart

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

SeqHiLo ( string sequence, string maxLo ) : IIdentityPart

uses an Oracle-style sequence (where supported)

Sequence ( string sequenceName ) : IIdentityPart

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.

UuidHex ( string format ) : IIdentityPart

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.

UuidString ( ) : IIdentityPart

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

Private Methods

Method Description
AddGeneratorParam ( string name, string innerXml ) : void
EnsureGuidIdentityType ( ) : void
EnsureIntegralIdenityType ( ) : void
EnsureStringIdentityType ( ) : void
IsIntegralType ( Type t ) : bool
SetGenerator ( string generator ) : void

Method Details

Assigned() public method

lets the application to assign an identifier to the object before Save() is called.
public Assigned ( ) : IIdentityPart
return IIdentityPart

Foreign() public method

uses the identifier of another associated object. Usually used in conjunction with a one-to-one primary key association.
public Foreign ( string property ) : IIdentityPart
property string
return IIdentityPart

Guid() public method

uses a new System.Guid as the identifier.
public Guid ( ) : IIdentityPart
return IIdentityPart

GuidComb() public method

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.
public GuidComb ( ) : IIdentityPart
return IIdentityPart

HiLo() public method

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
public HiLo ( string maxLo ) : IIdentityPart
maxLo string
return IIdentityPart

HiLo() public method

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
public HiLo ( string table, string column, string maxLo ) : IIdentityPart
table string
column string
maxLo string
return IIdentityPart

Identity() public method

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.
public Identity ( ) : IIdentityPart
return IIdentityPart

IdentityGenerationStrategyBuilder() public method

public IdentityGenerationStrategyBuilder ( IIdentityPart parent ) : System
parent IIdentityPart
return System

Increment() public method

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.
public Increment ( ) : IIdentityPart
return IIdentityPart

Native() public method

picks identity, sequence or hilo depending upon the capabilities of the underlying database.
public Native ( ) : IIdentityPart
return IIdentityPart

SeqHiLo() public method

uses an Oracle-style sequence (where supported)
public SeqHiLo ( string sequence, string maxLo ) : IIdentityPart
sequence string
maxLo string
return IIdentityPart

Sequence() public method

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.
public Sequence ( string sequenceName ) : IIdentityPart
sequenceName string
return IIdentityPart

UuidHex() public method

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.
public UuidHex ( string format ) : IIdentityPart
format string http://msdn.microsoft.com/en-us/library/97af8hh4.aspx
return IIdentityPart

UuidString() public method

uses a new System.Guid to create a byte[] that is converted to a string.
public UuidString ( ) : IIdentityPart
return IIdentityPart