Property name overwritten on update from database

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
picrap
Posts: 11
Joined: Thu 17 Nov 2011 11:34

Property name overwritten on update from database

Post by picrap » Thu 01 Dec 2011 13:22

Hi,

I have a very annoying problem: when a column changes in the DB schema (for example its description), the associated property name is overwritten by its default value.

For example, I have a DB column named "PERC" which means "PersonalCode".
At first generation, I renamed my column from "Perc" (default value) to "PersonalCode" (which is much more convenient, I hope you'll agree :)).
But when the column was updated (even with a very small change such as description update), the property name is set back to "Perc" (right, the default value).

Am I missing something somewhere? Is this a bug?

Thanks for help.
Pascal.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 05 Dec 2011 13:59

This is a designed behaviour.
Assuming that you are generating Entity Framewok models, Update Model From Database regenerates the corresponding properties in SSDL and CSDL if there are any differences between these properties in SSDL and their columns in database. As a workaround, clear selection of these tables in the update wizard.

picrap
Posts: 11
Joined: Thu 17 Nov 2011 11:34

Post by picrap » Tue 06 Dec 2011 08:12

Why don't you add an option to let the user chose if he wants to update the column name?

Actually, this is very annoying for me, because of two problems:
- comments are not kept when changed, so a comment always marks the column as changed
- a changed column has its name updated

So basically, as you suggest, I find myself analyzing hundreds of columns at each update, while only a few changed are actually significant.

This is a big loss of productivity yet, this is why I'm asking for such a feature.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 08 Dec 2011 15:00

Update Model From Database Wizard checks for a strict correspondence between database and the SSDL part of your model. This is correct behaviour and it should be applied to comments and column names as well.

If you change the name of your property in CSDL, it will not be detected by Update Model From Database Wizard. But if there are any discrepancies between SSDL and database for the particular column, the update wizard will regenerate this column's CSDL property as well - we will correct this behaviour in the next versions of Entity Developer. We will post here when it is implemented.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Property name overwritten on update from database

Post by Shalex » Mon 21 May 2012 10:18

The behaviour will be changed starting from the next build of Entity Developer: the CSDL property will be left unchanged when the corresponding SSDL property is regenerated. We will post here when the corresponding build is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Property name overwritten on update from database

Post by Shalex » Wed 23 May 2012 16:03

New version of Entity Developer 4.4 is released!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=24187 .

Post Reply