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
Aurelius brings all benefits an application can obtain from using an ORM framework. Main ones are:
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]));
Clearer business logic by dealing with objects, hiding all the database-access layer.
Easily change the underlying database - all your business code stays the same since they are just pure objects.
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;
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;
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;
Lifetime management of objects using object manager;
Cached and identity-mapped objects;
Automatic database structure generation;
Nullable types support;
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:
Basic info about how to get started using TMS Aurelius.
How you properly configure Aurelius to access the database where objects will be saved to.
Everything about the class-to-database mapping mechanism from TMS Aurelius.
Defining multiple mapping models in TMS Aurelius.
Querying, saving, updating, deleting and other topics about dealing with objects.
Performing queries at object level with TMS Aurelius.
Add declarative validations to your mapping to make sure your entity is persisted in a valid state.
Applying global filters to all entities at once, making it easy, for example, to build multitenant applications.
Using TAureliusDataset component to bind entity objects to data-aware controls.
Features for building distributed applications using Aurelius.
How to use the event system to receive callback notifications.
Some advanced topics about TMS Aurelius.