Creating a TPC Hierarchy via the Model Refactoring Wizard

The following procedure describes how to create a Table Per Concrete Type hierarchy using the Model Refactoring Wizard. For the purpose of this example we use the TPC_Horse and TPC_Dog tables. Both these tables contain the following identical columns: BirthDate and Genus.

First, we move the TPC_Horse and TPC_Dog tables onto the design surface to create classes with the same respective names:

images_TPC_Start

Then we select these two classes, call their context menu, and select the Model Refactoring menu item.

The Choose Action page of the Model Refactoring Wizard is displayed:

images_refactoring-wizard-TPC

On this page we select the Table-Per-Concrete-Type Hierarchy (TPC) option, specify the new base class name and click Finish.

note Note

Click the Preview link to preview the new base class properties in the Class Editor dialog box.

As a result we get a new base class connected with the two existing classes via a TPC inheritance:

images_TPC_Model_Final

 


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.