How do I use "ForeignKey" and "LinkTable" property attributes in Database Toolbox's ORM functionality in MATLAB R2024b?

I am trying to use the features of ORM that were released in MATLAB R2024b. There are two new properties "LinkTable" and "ForeignKey" that I want to use but there are no sufficient examples I could find in the documentation. What is the syntax I need to follow to add these properties to my ORM classes ?

 采纳的回答

"ForeignKey" and "LinkTable" are two new property attributes added to Database Toolbox's ORM functionality. Please refer to the files attached to this article that demonstrate a simple use-case describing Link Tables and Foreign Key.
To implement "LinkTable" please refer to: 
  1. "Address.m"
  2. "Customer.m"
  3. "LinkTableExample.mlx"
To implement "ForeignKey" refer to: 
  1. "Book.m"
  2. "Person.m"
  3. "ORMForeignKeyExample.mlx"
The M files define the relationship between the classes using the "LinkTable" and "ForeignKey" attributes respectively while the live scripts show a quick demo of creating the objects, writing them out to the database, and reading the objects back into MATLAB. 

更多回答(0 个)

产品

版本

R2024b

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by