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

Mapping and migration

3 Answers 82 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martin
Top achievements
Rank 1
Martin asked on 05 Dec 2008, 10:09 AM
Hello,

the automatic mapping of OpenAccess is quite comfortable in most situations, but in  a migration scenario it is important to know what member is mapped to what column.
Say in Version 1    3 members (m1, m2, m3) are references that are mapped to columns named id2, id3, id4. How can we be sure that those members are mapped to the same columns  in a Version 2 ? Vschema will check the schema changes. But what happens if a database created with Version 1 is accessed by a Version 2 application ? The columns would be the same, but the mapping may not!
How can we get knowledge of the member-mapping and how can this process be controlled by us ?


Thanks, Martin

3 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 08 Dec 2008, 08:28 AM
Hello Martin,
The VSchema tool can create ddl scripts for you. This can be done without applying those directly to the database. You should always have a version 1 database somewhere and, maybe your integration run, should generate such a script automatically that shows the mapping/schema migration from version 1 to version 2.

Kind regards,
Jan Blessenohl
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin
Top achievements
Rank 1
answered on 08 Dec 2008, 08:42 AM
Hi Jan,

the point is not to get information about schema changes. The point is to control the mapping.
If in Version 1 the mapping is:

ref1 -> col1
ref2 -> col2
ref3 -> col3

We had to realize that OpenAccess may decide to map it in an other way in version 2:

ref1->col2
ref2->col1
ref3->col3

There will be no schema changes in this case because the datatypes of both mappings are the same!
But the application won't work any more.

We figured out that a field entry in the class description of the app.config fixes this problem, but that means to manually set all the column names, which is a a considerable amount of work in a huge data model. It would be a great help if these entries could be generated by OA.

Thanks, Martin







0
Jan Blessenohl
Telerik team
answered on 08 Dec 2008, 04:55 PM
Hello Martin,
there is an API to traverse the complete mapping. It is in the OpenAccess.Runtime libary in the Debug namespace. With the help of that API you can proint out and diff the complete mapping.

Just call the static method: Telerik.OpenAccess.Debug.ModelHelper.GetModelFor(scope) to get the information.

Best wishes,
Jan Blessenohl
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Design Time (Visual Designer & Tools)
Asked by
Martin
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Martin
Top achievements
Rank 1
Share this question
or