Updating base classes not refreshing inherited classes in designer

4 posts, 0 answers
  1. Jason
    Jason avatar
    10 posts
    Member since:
    Jul 2010

    Posted 12 Aug 2011 Link to this post

    I have been playing with inheritance in the rlinq designer. The problem i am having is that if I update the base class (e.g. add a new field), the change is not propagated to the inheriting class.

    For example, if I have a base class of 'Animal' with 1 propery of 'Name', this being inherited by class 'Dog'. If I add the field 'Age'  to the 'Animal' class, there seems no way to propagate this to the 'Dog' class.

    The only way i have worked out so far is to delete the 'Dog' class and re-add it. This sometimes causes issues when i try to map to a table. I will get "An item with the same key has already been added" error.

  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 12 Aug 2011 Link to this post

    Hello Jason,

     Unfortunately our inheritance support in the designer is not full at the moment and this is one of the missing parts(adding as well as renaming base class properties does not update the inheritors) and the workaround at the moment is to delete the inheritance relationship and re-create it. You do not have to delete the whole Dog class, only the inheritance relationship and re-drag it from the toolbox.

    All the best,
    Zoran
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
  4. Jason
    Jason avatar
    10 posts
    Member since:
    Jul 2010

    Posted 13 Aug 2011 Link to this post

    thanks for the reply Zoran

    unfortunately when i do what you suggested it does not seem to completely fix the issue. Yes i can remove the inheritance, make the changes and then re set up the inheritance and the designer shows the correct information. but this sometimes leaves me with many errors. When i investigated further by opening the .rlinq file as xml, it seems the  "<orm:class..." holds copies of both the old and the new versions of the changes i made. For example I had a field "rv" to hold the row version, I changed it from "rv" to "RV" now the "<orm:Class" in the xml holds both and obviously generates errors when trying to compile.

    This in itself wouldnt be an issue as I could just delete the "rv" propery in the xml. however there are other links to this property and (row versioning etc) and this basically means i have to revert to an older version of the file and try again as I cant fix all the issues.

    any advice would be greatly appriciated

    Jason
  5. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 17 Aug 2011 Link to this post

    Hello Jason,

     You are right, with renaming a base class field is problematic with horizontal inheritance and might require deleting the whole entity and re-creating it. You can delete only the inheritance relationship as well but only prior to renaming the property. After doing all the required operations you can re-create the inheritance relation. All these problems should be there only in the cases where you have horizontal inheritance strategy, vertical and flat should not have any impact from editing the base class.

    These issues are known to us but, we have not addressed them yet as there is some higher priority development at the moment and the workarounds are available. However you can be sure that all these issues will be addressed for one of our next releases in the near future. I sincerely apologize for the headaches they might have caused you.

    All the best,
    Zoran
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top