Table of Contents

Overview

TMS Aurelius is an Object-Relational Mapping (ORM) framework. Its purpose is to be the definitive ORM framewok for the Delphi environment, with full support for data manipulation, complex and advanced queries, inheritance, polymorphism, among others. This manual covers all topics needed for you to know about Aurelius and start using it.

TMS Aurelius product page: https://www.tmssoftware.com/site/aurelius.asp

TMS Software site: https://www.tmssoftware.com

Benefits

Aurelius brings all benefits an application can obtain from using an ORM framework. Main ones are:

Productivity:
Avoid complex SQL statements that can only be verified at runtime. Code directly with objects.

Instead of this code:

Query1.Sql.Text :=
  'SELECT I.ID AS INVOICE_ID, I.INVOICE_TYPE, I.INVOICENO, I.ISSUE_DATE, ' +
  'I.PRINT_DATE, C.ID AS CUSTOMER_ID, C.CUSTOMER_NAME, C.SEX, C.BIRTHDAY, ' +
  'N.ID AS COUNTRY_ID, N.COUNTRY_NAME' +
  'FROM INVOICE AS I INNER JOIN CUSTOMER AS C ON (C.ID = I.CUSTOMER_ID) ' +
  'LEFT JOIN COUNTRY AS N ON (N.ID = C.COUNTRY_ID)' +
  'WHERE I.ID = :INVOICE_ID;'
Query1.ParamByName('INVOICE_ID').AsInteger := 1;
Query1.Open;
ShowMessage(Format('Invoice No: %d, Customer: %s, Country: %s',
  [Query1.FieldByName('INVOICE_ID').AsInteger,
  Query1.FieldByName('CUSTOMER_NAME').AsString,
  Query1.FieldByName('COUNTRY_NAME').AsString]));

Write this code:

Invoice := Manager1.Find<TInvoice>(1);
ShowMessage(Format('Invoice No: %d, Customer: %s, Country: %s',
  [Invoice.InvoiceNo, Invoice.Customer.Name, Invoice.Customer.Country.Name]));

Maintainability:
Clearer business logic by dealing with objects, hiding all the database-access layer.

Portability:
Easily change the underlying database - all your business code stays the same since they are just pure objects.

Features

Here is a list of main features of TMS Aurelius framework:

  • Several database servers supported (MS SQL Server, Firebird, MySQL, PostgreSQL, Oracle, etc.);

  • Several database-access components supported (FireDac, UniDac, dbExpress, ADO, AnyDac, SQLDirect, etc.);

  • Native database drivers allow direct database access without needing a 3rd party component;

  • Import existing database model and generate mapped Aurelius entity classes from it;

  • Multi-platform solution - Win32, Win64, Mac OS X, Linux, VCL, FireMonkey;

  • Saving, updating and loading of entity objects in an object-oriented way;

  • Queries - Powerful query API using criteria expressions, projections, grouping, conditions and even logical operators in a LINQ-like approach;

  • Inheritance mapping and polymorphism - map a full class hierarchy into the database;

  • Visual data binding with data-aware controls using full-featured TAureliusDataset component;

  • Cross-database development - use a single Delphi code to target multiple databases in a transparent way;

  • Choose from classes-to-database approach (creating the database structure from classes) or database-to-classes approach (creating classes source code from database, using TMS Data Modeler);

  • Mapping directly in classes using custom attributes;

  • Association mapping;

  • Lifetime management of objects using object manager;

  • Cached and identity-mapped objects;

  • Automatic database structure generation;

  • Nullable types support;

  • Lazy loading for associations and blob fields;

  • Allows logging of SQL commands;

  • Allows mapping enumerated types to database values;

  • Open architecture - easy extendable to use different component sets or database servers;

  • Available for Delphi 2010 and up.

In this section:

Getting Started

Basic info about how to get started using TMS Aurelius.

Database Connectivity

How you properly configure Aurelius to access the database where objects will be saved to.

Mapping

Everything about the class-to-database mapping mechanism from TMS Aurelius.

Multi-Model Design

Defining multiple mapping models in TMS Aurelius.

Manipulating Objects

Querying, saving, updating, deleting and other topics about dealing with objects.

Queries

Performing queries at object level with TMS Aurelius.

Dictionary

Dictionary allow building Aurelius queries in an even easier and more productive way.

Data Validation

Add declarative validations to your mapping to make sure your entity is persisted in a valid state.

Filters

Applying global filters to all entities at once, making it easy, for example, to build multitenant applications.

Data Binding - TAureliusDataset

Using TAureliusDataset component to bind entity objects to data-aware controls.

Distributed Applications

Features for building distributed applications using Aurelius.

Events

How to use the event system to receive callback notifications.

Advanced Topics

Some advanced topics about TMS Aurelius.