Skip to main content

SchemaNameAttribute Class

Specifies the name of a database schema in which a table mapped to an entity class is created.

Declaration

SchemaNameAttribute = class(
    TCustomAttribute
)

Remarks

The specified schema name is used only if the connected database supports schemas. The table is created in the default schema (e.g., ‘dbo’ for Microsoft SQL Server databases) if the schema name is not specified. In addition to the SchemaNameAttribute, you can specify a schema name via the TableAttribute. If both the attributes specify schema names, the most recently specified one is in effect for the table.

The following code designates a schema called ‘MySchema’ for the TPerson entity class.

uses
  ..., dxEMF.Core, dxEMF.Attributes;
type
  [Entity]
  [SchemaName('MySchema')]
  TPerson = class
  // ...
  end;

Inheritance

TObject
TCustomAttribute
SchemaNameAttribute
See Also