database.orm.mixin.Mappable Class
Namespace: database.orm.mixin
Provide attributes for defining how subclasses map to relational database tables
Since R2023b
Description
database.orm.mixin.Mappable
is an abstract class that provides
attributes for defining how subclasses are mapped to relational database tables. Methods such
as ormread
, ormwrite
, and ormupdate
use these attributes to
read and write objects directly to and from databases.
Class Attributes
Abstract | true |
HandleCompatible | true |
For information on class attributes, see Class Attributes.
Methods
Public Methods
rowfilter | Return an unconstrained |
More About
Mappable
Class Attributes
These class attributes are specific to Mappable
subclasses.
TableName | Defines the name of the corresponding table on the database. |
Catalog | Defines the catalog where the corresponding table resides. |
Schema | Defines the schema where the corresponding table resides. |
Standard attributes also apply to Mappable
subclasses.
For details, see Class Attributes.
Mappable
Property Attributes
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:
Supported databases include:
|
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:
|
Standard attributes also apply to Mappable
subclasses.
For details, see Property Attributes.
Version History
Introduced in R2023bR2024b: Support ORM class mappings with Mappable
attributes
You can now use link tables or foreign keys to specify relationships between ORM classes.
R2024a: Insert ORM objects with autoincrementing primary keys
You can now use autoincrementing primary keys by setting the
Autoincrement
property attribute.
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)