Generates a new identifier by getting the value of the identifier for the obj parameter.

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

Syntax

Visual Basic (Declaration)
Public Function Generate ( _
	session As ISessionImplementor, _
	obj As Object _
) As Object
C#
public Object Generate(
	ISessionImplementor session,
	Object obj
)
Visual C++
public:
virtual Object^ Generate(
	ISessionImplementor^ session, 
	Object^ obj
) sealed
JavaScript
function generate(session, obj);

Parameters

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

Return Value

The value that was assigned to the mapped id's property.

Implements

IIdentifierGenerator..::.Generate(ISessionImplementor, Object)

Exceptions

ExceptionCondition
NHibernate.Id..::.IdentifierGenerationException Thrown when a IPersistentCollection is passed in as the obj or if the identifier of obj is null.

See Also