Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
How to: Define a Model with Mixed (Flat and Vertical) Mapping
Programmer's Guide > OpenAccess ORM Classic (Old API) > OpenAccess Tasks > Defining a Data Model > How to: Define a Model with Mixed (Flat and Vertical) Mapping

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

Telerik OpenAccess ORM supports mixing of flat and vertical mappings in the same hierarchy. For example, in order to save database space, user is able to use vertical mapping only for seldom-used subclasses with many large fields. Changing the inheritance strategy to vertical have to be done only for these classes and the default settings should be used for the rest.
In the example if both ‘Dog’ and ‘Cat’ strategies are changed to vertical with ‘WeinerDog’ and ‘Rottweiler’ left flat, the hierarchy will be mapped to three database tables as shown below. A discriminator column (‘voa_class’) is added to the base table to distinguish between ‘Dog’, ‘WeinerDog’ and ‘Rottweiler’.


In the App.config file this mapping configuration looks like this:

App.config: Copy Code
<namespace name="Inheritance.Model">
<class name="Cat">
<extension key="db-inheritance" value="vertical" />
<class name="Dog">
<extension key="db-inheritance" value="vertical" />
<class name="Pet" />
<class name="Rottweiler" />
<class name="WienerDog" />