Skip to main content

IndexedAttribute Class

Specifies if a field’s/property’s mapped column makes up a non-unique index on a data store table to which an entity class is mapped.

Declaration

IndexedAttribute = class(
    TCustomAttribute
)

Remarks

Unlike the IndexesAttribute, the IndexedAttribute applies to a field/property and allows you to create a non-unique index on its mapped column. To make this index unique, add the UniqueAttribute.

The following code uses the IndexedAttribute and the UniqueAttribute to create a simple unique index on the ISDN column mapped to the FISDN field.

uses
  ..., dxEMF.Core, dxEMF.Attributes;
type
  [Entity]
  [Automapping]
  TGadget = class
  strict private
    FId: Integer;
    [Indexed, Unique]
    FISDN: string;
  public
    // ...
  end;

Inheritance

TObject
TCustomAttribute
IndexedAttribute
See Also