Field naming & migrate database bug?

5 posts, 0 answers
  1. Ohsha
    Ohsha avatar
    57 posts
    Member since:
    Mar 2012

    Posted 09 Apr 2012 Link to this post

    Hi, 

    I defined my DB schema in OpenAccess.

    I chose a field named "ID" and later realized that it is mapped as [i_d] in the database table. 
    So I changed the field name to "Id". To my surprise, OpenAccess told me "no change to DB schema" when I tried to "migrate database". 
    Only after I've change to "Create Database" did I see that the mapped field name was changed to [id] in the script window. 

    I think this is a bug of OpenAccess. 

    Please verify. 
    Thanks


     


  2. Ohsha
    Ohsha avatar
    57 posts
    Member since:
    Mar 2012

    Posted 09 Apr 2012 Link to this post

    A side question, 

    why the attribute "Comment" is mapped as "[commnt]" in database (lacking the 'e')?

  3. DevCraft banner
  4. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 10 Apr 2012 Link to this post

    Hello Ohsha,

    Actually this is an expected behavior. In this case a default mapping is being used for the classes which are not explicitly mapped to tables. This mechanism will calculate the table mapping for the classes and will use a default naming strategy for the class and the property name generation.

    What you could do is to map these classes to tables using the Table Editor.

    Hope that helps. If any other questions arise do not hesitate to contact us back.

    All the best,
    Damyan Bogoev
    the Telerik team
    Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
  5. Ohsha
    Ohsha avatar
    57 posts
    Member since:
    Mar 2012

    Posted 10 Apr 2012 Link to this post

    Thanks Damyan, but I don't quite understand your answer. 

    My questions were:

    1. why mapped field name changed but migrate database wasn't able to detect that?
    2. why characters are missing from mapped field name?

    Which one is expected behavior?

  6. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 11 Apr 2012 Link to this post

    Hi Ohsha,

    When Default Mapping is being used for a given persistent capable class this means that Telerik OpenAccess ORM will take care of the property to column mapping and will calculate automatically the metadata for the corresponding relational part, using default settings for:

    - Table / column naming strategy.  The naming strategy, for example, will change all letters to lower, will remove the vowel letters, etc. ;

    - Type mapping between CLR to SQL types;

    - Concurrency control mechanism, etc.;

    I am sorry for the inconvenience caused.


    All the best,
    Damyan Bogoev
    the Telerik team
    Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
Back to Top
DevCraft banner