Table of Contents

TAbstractGenerator.GenerateId Method

Generates a new identifier value for the given entity before it is inserted into the database.

Syntax

Unit: Aurelius.Id.AbstractGenerator

function TAbstractGenerator.GenerateId(Entity: TObject; Performer: ICommandPerformer): Variant; virtual; abstract;

Parameters

<-> Parameter Type Description
Entity TObject The entity object for which a new identifier is being generated.
Performer ICommandPerformer An ICommandPerformer that can execute SQL statements against the database, available for generators that need to query a sequence or other database object.

Returns

The new identifier value to assign to the entity, or an unassigned Variant (Unassigned) when the identifier will be generated by the database itself (e.g., an identity column). Returning Unassigned causes Aurelius to skip the identifier column on INSERT and call RetrieveIdAfterInsert afterwards.

See also