Skip to main content

DBTypeAttribute Class

Specifies the data store type of a table column to which an entity class‘s field/property maps its data.

Declaration

DBTypeAttribute = class(
    TCustomAttribute
)

Remarks

The ExpressEntityMapping Framework automatically chooses a database-specific column type based on the mapped field’s/property’s data type. You can use the DBTypeAttribute to override the default behavior.

The following code example customizes the default column type for a TGUID field.

uses
  ..., dxEMF.Core, dxEMF.Attributes;
type
  [Entity]
  TPerson = class
  strict private
    [Column, Key, DbType('char(40)')]
    FId: TGUID;
    // ...
  end;

Inheritance

See Also