Another 'voa_keygen' issue

2 posts, 0 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    Apr 2014

    Posted 14 Jun 2014 Link to this post

    I've read all of the old posts as well as the blog posts on this subject.  All of them indicate that this is related to either entities that don't have a PK, or PK's using the hi-lo key generator; and in some cases using views.  All of my entities using GUIDs with the IncrementalGuid key generator, except one which is an Integer and use the DatabaseServerCalculated.

    And yet I continue to get this error; if I create the table everything functions as I would expect and I get no errors.  Is this just a required table to use Telerik Data Access?
  2. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 18 Jun 2014 Link to this post

    Hello Mark,

    In general, Telerik Data Access needs every persistent class to have at least one persistent property marked as its identity. In other words, regardless of the key generator, there should be a property for which the Identity property is set to True.

    For example, if you have the User persistent class with the following properties: UserID of type GUID, UserName of type String and Password of type String, for .rlinq files, the Identity property of UserID should be True, and for fluent models the IsIdentity(KeyGenerator keyGen) method should be called in the configuration of the property. In case User has no property marked as identity, the first query your code issues against the database will result in the error you experience, even if you query a completely different persistent class.

    With this in mind, to resolve the situation on your side if you have an .rlinq file, you can check in Error List, if it contains an error with text that follows this pattern: The persistent type <type_name> has no primary key specified. If it does, you can double-click on the error and our Validation dialogue will open to assist you in the resolution process.

    If you have a fluent model, you need to go through the mapping configuration of each persistent class and make sure that the IsIdentity() method is called for the appropriate properties.

    In case this does not work for you, do not hesitate to get back to us.



    Regards,
    Doroteya
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  3. DevCraft banner
Back to Top