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

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

Syntax

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

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