Reverse Mapped project and Inheritance

4 posts, 1 answers
  1. Netforce
    Netforce avatar
    5 posts
    Member since:
    Mar 2010

    Posted 15 Feb 2011 Link to this post

    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
  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 17 Feb 2011 Link to this post

    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
  3. DevCraft banner
  4. Netforce
    Netforce avatar
    5 posts
    Member since:
    Mar 2010

    Posted 18 Feb 2011 Link to this post

    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
  5. Answer
    PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 23 Feb 2011 Link to this post

    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!
Back to Top