Cant get horizontal inheritance working

Thread is closed for posting
2 posts, 0 answers
  1. Alex
    Alex avatar
    22 posts
    Member since:
    Jun 2010

    Posted 12 Aug 2010 Link to this post

    I'm trying to build my first openaccess orm application. I have downloaded and installed latest version of ORM Express.
    Then I have created new solution in Visual Studio 2010, and created class library project.

    I then added domain model, pointing to "empty" SQL 2008 EXPRESS database.

    In visual designer, I've added class called BaseEntity with just one property (ID: Int32)
    And then added class called User with properties (Username:string, Password: string, Email: string)
    I have added Inheritance between these 2 classes. Then selected BaseEntity class and specified Horizontal inheritance strategy in Inheritance mapping window. When I trying to save my model, it give me different errors:

    1. If I set Identity to true for BaseEntity class, ID property, it give me error that horizontal base class cant have identity
    2. The only way I can add identity to my User class, by adding new property ID to User class, which hides base ID property. This resolved all errors, but when I generate script using Update Database from Model, table User contains 2 ID properties, which is wrong.

    Can you please explain correct way to use horizontal inheritance. Is it possible in OpenAccess to define base class for all entities with ID property?

  2. Zoran
    Zoran avatar
    534 posts

    Posted 13 Aug 2010 Link to this post

    Hi Alex,

     At its current status, the Visual Designer only supports vertical and flat inheritance. Horizontal will be supported by the Q3 2010 release. I suggest you to have a look into the following blog post series that discuss inheritance in OpenAccess domain model.

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top