These property attributes are specific to Mappable subclasses.
ExcludeFromDatabase | If true, identifies a property that should not be saved as a database
column. |
PrimaryKey | If true, the associated column is a part of the table's primary key. Requires
ExcludeFromDatabase to be false. At least one property must
have the PrimaryKey property. |
ColumnName | Defines the name of the associated column on the database table. |
ColumnType | Defines the type of the associated column on the database table. |
AutoIncrement (since R2024a) | If true and if the data type is integer:
The database automatically creates values for the
PrimaryKey property when you insert the property with
the ormwrite
method. Requires PrimaryKey to be true. The ormwrite method creates a table definition with
an autoincrementing primary key column.
Supported databases include:
PostgreSQL MySQL® MariaDB® SQLite Microsoft®
SQL Server® Microsoft Access® Oracle®
|
ForeignKey (since R2024b) | If true, indicates that the property represents a foreign key
relationship between the referencing class and the referenced class. Limitations include:
|
LinkTables (since R2024b) | If true, the property represents a link table on the database enforcing
a many-to-many relationship between two classes. Limitations include:
The property class must be a subclass of
database.orm.mixin.Mappable . Values of the property can be vectors, scalars, or empty.
|
Standard attributes also apply to Mappable
subclasses.
For details, see Property Attributes.