QCubed and Foreign Key Relationships
In addition to your basic CRUD functionality, QCubed will also analyze the foreign key relationships in your database to generate relationships between your data model's objects.
Whenever your table has a column which is a foreign key to another table, the dependent class (the table with the FK) will have an instance of the independent class (the table where the FK links to). So in our Examples Site Database, we have a manager_person_id column in our project table. This results in a ManagerPerson property (of type Person) in our Project class.
Note that the ManagerPerson property is a read/write property. It can be modified just like any other property, like Name and Description.
Load a Project Object and its ManagerPerson
- Project ID: 3
- Project Name: Blueman Industrial Site Architecture
- Manager Person ID: 1
- Manager's First Name: John
- Manager's Last Name: Doe