Show/Hide Toolbars

TMS Data Modeler Documentation

TMS Aurelius is a Delphi framework for Object-Relational Mapping (ORM), allowing you to save/load data to database using classes instead of directly using SQL Statements. For it to work, you must create (or use) your Delphi classes and then add attributes to it allowing the framework to know to which table and field each object and property will be saved.

 

TMS Data Modeler saves you time in the process of creating such classes, by generating the classes automatically based on tables and fields defined in the database. To export the current schema to classes, use the File Menu, option "Export | Delphi (TMS Aurelius)", or the "TMS Aurelius" button in Tools ribbon.

 

datamodeler_aurelius_button

 

Each table in Data Modeler will become a class. Each table column will become a class field/property. Foreign keys will become associations (properties of an object type). So for example, this Orders table:

 

datamodeler_aurelius_diagram

 

will become this class and mappings:

 

  [Entity]
  [Table('Orders')]
  [Id('FOrderID', TIdGenerator.IdentityOrSequence)]
  TOrder = class
  private
    [Column('OrderID', [TColumnProp.Required, TColumnProp.NoInsert, TColumnProp.NoUpdate])]
    FOrderID: integer;
    [Column('OrderDate', [])]
    FOrderDate: Nullable<TDateTime>;
    [Column('ShippedDate', [])]
    FShippedDate: Nullable<TDateTime>;
    [Association]
    [JoinColumn('CustomerID', [], 'CustomerID')]
    FCustomer: Proxy<TCustomer>;
    [Association]
    [JoinColumn('EmployeeID', [], 'EmployeeID')]
    FEmployee: Proxy<TEmployee>;
    [ManyValuedAssociation([], [TCascadeType.SaveUpdate, TCascadeType.Merge], 'FOrderID')]
    FOrderDetailsList: Proxy<TList<TOrderDetails>>;
    function GetCustomer: TCustomer;
    procedure SetCustomerID(const Value: TCustomers);
    function GetEmployee: TEmployee;
    procedure SetEmployee(const Value: TEmployee);
    function GetOrderDetailsList: TList<TOrderDetails>;
  public
    constructor Create;
    destructor Destroy; override;
    property OrderID: integer read FOrderID;
    property OrderDate: Nullable<TDateTime> read FOrderDate write FOrderDate;
    property ShippedDate: Nullable<TDateTime> read FShippedDate write FShippedDate;
    property Customer: TCustomer read GetCustomer write SetCustomer;
    property Employee: TEmployee read GetEmployee write SetEmployee;
    property OrderDetailsList: TList<TOrderDetails> read GetOrderDetailsList;
  end;