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

Reverse Mapped project and Inheritance

3 Answers 114 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.
Netforce
Top achievements
Rank 1
Netforce asked on 15 Feb 2011, 10:29 AM
We have a project that is reversed mapped. Then we have created an inheritance structure. When doing that, the Telerik ORM created a metaproperty on the base class called voa_class.

We have data in this structure today and the voa_class is null for all existing objects. My question is: How to generate the data in the voa_class for existing objects?

The following exception is thrown:
{"Row for OID GenericOID@118e3749 Report ID=f2bb71d2-e335-46ba-ae3e-003d9b2c3556 NOTRES  is not in the hierarchy starting at Data.Report ('Report') (voa_class for row is )"}

/Andreas

3 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 17 Feb 2011, 06:30 PM
Hello Netforce,

 You will have to manually assign it with an sql query. The problem here is that when you originally created your table there was no inheritance defined, and therefore no voa_class column has been created. The moment you defined an inheritance hierarchy a voa_class column has been created, and that column will hold the value that will distinguish your class from one another. Unfortunately the value for already excising entries would be null and there is no out of the box way to populate it.
The exception you are seeing is caused by the fact that our runtime expects to find a value for that column and use it to distinguish your entry from the others, and when it does not find any an exception is thrown.
We are aware of that issue and we are going to address it soon. 

Regards,
Petar
the Telerik team
0
Netforce
Top achievements
Rank 1
answered on 18 Feb 2011, 08:49 AM
Hello Petar

Thank You for You response.

Could You please supply an example for how to populate the column? Is it the "child ID" or something completely different?

/Andreas
0
Accepted
PetarP
Telerik team
answered on 23 Feb 2011, 09:00 PM
Hello Netforce,

 That pretty much depends on the value you have chosen yourself. We provide two automatic values which are:
1. Full class name.
2. Class ID.
If you don't think that those will fit your specific scenario you can always provide a custom value to the column.
Here is a sample update script that updates the voa_class column in the product class.

Update Products
set voa_class = 5561

Best wishes,
Petar
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Data Access Free Edition
Asked by
Netforce
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Netforce
Top achievements
Rank 1
Share this question
or