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

Reverse mapping, field length inconsistent

1 Answer 42 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.
Robert Lautenbach
Top achievements
Rank 1
Robert Lautenbach asked on 14 May 2010, 10:25 PM
I've noticed that changing field lengths on foreign key varchar or char fields produces some unexpected results. I started off with a field that was 50 characters. I changed to 10 characters and ran a reverse update merge.

As you can see here, the configuration settings show 10 for the fk id field (the first one) and 50 for the lookup field.

            <field name="_lookupCriteriaOperatorCode">
              <extension key="db-column">
                <extension key="db-type" value="VARCHAR" />
                <extension key="db-column-name" value="lookup_criteria_operator_code" />
                <extension key="db-length" value="10" />
              </extension>
            </field>
            <field name="_lookupCriteriaOperator">
              <extension key="db-column">
                <extension key="db-type" value="VARCHAR" />
                <extension key="db-column-name" value="lookup_criteria_operator_code" />
                <extension key="db-length" value="50" />
              </extension>
            </field>

The only way to correct this was to go back and manually edit the incorrect xml. This seems like a bug. It can be dangerous on char/varchar fields because it causes string truncation when the value is lower than it should be.


1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 19 May 2010, 11:14 AM
Hi Robert Lautenbach,

 I assume you are using MS SqlServer. I did try to reproduce the problem by starting of with a FK constraint on an varchar(50) column. I generated the classes and mapping and then modified the length of the FK column to 20. The database enforces this length on the referenced PK column also.
If I now do a 'Merge' using the wizard, the reference field mapping needs to be done again. We will look into this. But once the reference field is mapped again and the class is regenerated, I get the same column length for both the fields. So in short, I could not generate the same mapping ambiguity that you posted.

Can you provide the exact steps you did to reproduce the problem?

Sincerely yours,
Ady
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.
Tags
Design Time (Visual Designer & Tools)
Asked by
Robert Lautenbach
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or