This is a migrated thread and some comments may be shown as answers.

Field naming & migrate database bug?

4 Answers 55 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ohsha
Top achievements
Rank 1
Ohsha asked on 09 Apr 2012, 08:40 PM
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


 


4 Answers, 1 is accepted

Sort by
0
Ohsha
Top achievements
Rank 1
answered on 09 Apr 2012, 09:21 PM
A side question, 

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

0
Damyan Bogoev
Telerik team
answered on 10 Apr 2012, 04:30 PM

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. 
0
Ohsha
Top achievements
Rank 1
answered on 10 Apr 2012, 08:49 PM
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?

0
Damyan Bogoev
Telerik team
answered on 11 Apr 2012, 10:04 AM

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. 
Tags
Data Access Free Edition
Asked by
Ohsha
Top achievements
Rank 1
Answers by
Ohsha
Top achievements
Rank 1
Damyan Bogoev
Telerik team
Share this question
or