The vertical inheritance is not deprecated but it is more often used in model first
or code-only scenarios
rather then in database first scenarios
. You could learn in more details how vertical inheritance work from this documentation article
, but basically each class of the hierarchy has its own table and the corresponding tables are linked with one-to-one associations. In order to retrieve data joins are performed.
This means that in the database first scenario
it is possible to convert the one-to-one association to vertical inheritance hierarchy. However this is no longer required because Telerik Data Access
would automatically map one-to-one associations representing the exact database schema in the domain model.
To compare those two approaches lets model the set-up you described both using vertical inheritance and one-to-one association using the Visual Designer
and compare the resulting database scripts. Please see the attached screenshots.
In the first case I have created the standard one-to-one association as described here
In the second case I have create vertical inheritance hierarchy. For the Member
and the USResident
classes through the Mapping Details Editor, I have set the Inheritance Strategy
and the Descriminator Value
- to Class Full Name
where as the User
class has Default Inheritance Strategy
and Descriminator Column
set to None
The in both scenarios, using the Update Database From Model
I have created the corresponding DDL script. Please note that in both cases the scripts are equivalent.
To answer you question, in case of one-to-one association mapping, if a User
is not a Member
would be null.
I hope this is helpful. Do not hesitate to contact us if you have any further questions.
OpenAccess ORM is now Telerik Data Access
. For more information on the new names, please, check out the Telerik Product Map