Table of Contents

IdAttribute Class

Specifies the identifier (primary key) of an entity class and how its value is generated.

Remarks

Every entity must have exactly one identifier so that Aurelius can uniquely manage and persist its instances. This attribute is a class-level attribute and refers to a field or property by name. For composite identifiers, apply multiple Id attributes; in that case the generator is ignored and TIdGenerator.None is used for all parts. The identifier field or property must not be declared as lazy-loaded when it is part of a composite identifier. When using inheritance, declare Id only on the base class of the hierarchy.

Syntax

Unit: Aurelius.Mapping.Attributes

IdAttribute = class(TCustomAttribute);

Constructors

Properties

Name Description
Generator Gets the built-in identifier generator strategy.
GeneratorClass Gets the custom identifier generator class, if one was specified.
MemberName Gets the name of the field or property used as the entity identifier.