Managing Inheritance Using Multiple-Row-Type Tables
Multiple-row-type tables can be useful when you want to represent objects of different types from the same
For example, assuming that the employees relation in a Department object contains both Employee objects and Executive objects, you may want to store objects of both types in the same table. Instructions to create such a table in Server Studio are provided in Server Studio Advanced Features.
The following
represent IlsSwTable AllEmployeeTable:
string column[1]="name";
string column[2]="hireDate";
string column[3]="monthCost";
string column[4]="title";
Collector rows=employees->employeeRow;
string rowType="Employee,employeeRow";
string collectorName="rows";
propagate employees;
subscribe Employee:
represent IlsSwRow employeeRow
## draggedPath=employees.Executive:
mandatory Ref<IlsSwTable> table=view.origin->AllEmployeeTable;
string column[1]=name;
int column[2]=hireDate;
int column[3]=monthCost;
subscribe Executive:
represent IlsSwRow executiveRow
## draggedPath=employees.Executive:
mandatory Ref<IlsSwTable> table=view.origin->AllEmployeeTable;
string column[1]=name;
int column[2]=hireDate;
int column[3]=monthCost;
string column[4]=title;
This code sample can be illustrated as follows:
Multiple-Row-Type Table for Inheritance
Whereas the class Executive inherits from the class Employee in the server object model, the instances of these classes are represented by two different
As usual, the table schema must be shared by all rows that reference this table.
You can explicitly create instances of the Executive server type by using the