Table of Contents

TAutomappingEngine Class

Defines the naming conventions used when automapping Delphi classes to database tables and columns.

Remarks

When the Automapping attribute is applied to a class, Aurelius uses an instance of TAutomappingEngine to derive table names, column names, join column names, and sequence names from RTTI information. The default implementation strips the leading T prefix from class names and the leading F prefix from field names, then converts PascalCase to UPPER_SNAKE_CASE (e.g. TOrderItem -> ORDER_ITEM, FCustomerName -> CUSTOMER_NAME). To apply different conventions, inherit from TAutomappingEngine, override the relevant virtual methods, and pass the subclass to the Automapping attribute: [Automapping(TMyEngine)].

Syntax

Unit: Aurelius.Mapping.Automapping

TAutomappingEngine = class(TObject);

Methods

Name Description
GetColumnName Returns the database column name for the given RTTI member.
GetForeignJoin​Column​Name Returns the foreign key column name placed in the child table for a one-to-many association.
GetJoinColumnName Returns the foreign key column name for a many-to-one association.
GetSequenceName Returns the database sequence name used for identifier generation for the given class.
GetTableName Returns the database table name for the given class.