This is a migrated thread and some comments may be shown as answers.

Need to inherit from a domain class that is not persisted to the database

1 Answer 19 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 23 Oct 2013, 04:30 PM
Hi There,

Been looking for ages on a solution to this. 

Basically I would like to have a set of domain classes that inherit from another domain class where none of these classes will be tables in databases but instances will be created in memory/retrieved from the cache.

The problem im hitting is when trying to define a discriminator column the mappings editor does not seem to allow me to select a discriminator column as it only looks at columns that are mapped to a db.

Is this possible???

Thanks.

1 Answer, 1 is accepted

Sort by
0
Kristian Nikolov
Telerik team
answered on 24 Oct 2013, 02:18 PM
Hello Chris,

It is possible to inherit from classes which will not be persisted to the database. The way to achieve this is to use Horizontal Inheritance. It can be specified for the parent classes in the inheritance graph. Classes marked for Horizontal Inheritance will not have tables in the database and thus their instances cannot be persisted but can be instantiated. You can model Horizontal Inheritance in the following way:

I hope this helps.

Regards,
Kristian Nikolov
Telerik
OpenAccess ORM Q3 2013 Beta is available for immediate download in your account. Get it now and play with the latest bits. See what's new >>
Tags
Data Access Free Edition
Asked by
Chris
Top achievements
Rank 1
Answers by
Kristian Nikolov
Telerik team
Share this question
or