Problem with Identity mechanism in visual model after update

2 posts, 1 answers
  1. Henk
    Henk avatar
    113 posts
    Member since:
    Apr 2006

    Posted 05 Nov 2010 Link to this post


    I create a new Domain Model with the Telerik OpenAccess ORM Data Wizard and choose "BackendCalculated" for the Identity Mechanism for each object and save it.
    If I afterwards update my model from the database (In the Model Schema Explorer right click and choose "Update From Database..") because I added columns in my database table, there is a problem with the Identity mechanism in the objects. It behaves like it is not set to "BackendCalculated"

    It looks like the visual presentation of the object properties in the model is not in sync with the actual model definition. Because if I switch  "Identity mechanism" to default, save the model, and change it back to "BackendCalculated", and save again, it is working as expected.

    Kind Regards.
  2. Answer
    Alexander avatar
    727 posts

    Posted 10 Nov 2010 Link to this post

    Hi Henk,

    You are right, it really seems that the meta class on the diagram is not synchronized with the actual persistent class definition, we will have to investigate and fix this, thank you for reporting it.
    When you applied the changes from the database, the identity mechanism property of the persistent class has been changed back to Default. This is in fact expected behavior because when you set the identity mechanism of the class to Backed Calculated, an attribute named Autoinc is set to true on the primary key column of the meta table instance. Later, when you update from database, there is a change detected for this Autoinc attribute. If you do not apply this change the identity mechanism of the class will be left as you have set it (BackendCalculated).
    In the Update from Database wizard you are able to see this change if you double-click on the table detected as modified, and then once again on the primary key column. In this case you can apply the changes only for the newly added columns and skip the one for the primary key column that would change the identity mechanism if applied.
    Hope that helps.

    Sincerely yours,
    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
  3. DevCraft banner
Back to Top