The SmartFramework allows developers to define relations between database tables and referential integrity based on those relations. The referential integrity is then automatically validated by the SmartDataAccess class.
In order to use these features the Business Entities and Data Access classes that should leverage the referential integrity validation need to inherit directly or indirectly form the SmartBusinessEntity and SmartDataAccess classes.
Importing Database Tables into the SmartDB
The referential integrity is based on relations defined in the SmartDB’s extended meta-schema. In order to define relations the database tables need to be imported into the extended meta-schema first using the “Database Table Maintenance” program of the SmartFramework Maintenance.
Using the "Import Tables" button in the Ribbon
You can import the missing tables of any connected database:
After confirming the dialog the tables of the selected database will appear in the grid view of the “SmartTable Maintenance” form.
Defining Relations between Database Tables
Using the Relation Maintenance screen you can now define relations between database tables.
The following table describes the fields of the relation definition: