Page 1 of 1

Wrong Entity Key from Oracle View

Posted: Tue 28 Dec 2010 13:01
by keeper
Hi, I generated an Entity class from an Oracle view (which obviously has no primary key) and the Entity Developer added a key on a (random?) column. As a result my queries had wrong results (i.e. many repeated rows).

Then I tried to change the key to two other columns (which I know their values are unique among the view rows) but the designer kept telling me that there was an error.

The only solution I found was to manually edit the .edml file using VS XML Editor and change the section of my .

Is this a bug, a feature or am I missing something?

Thanks.

Posted: Tue 28 Dec 2010 13:30
by AndreyR
If an entity does not have Primary Key, Entity Developer performs an attempt to infer a new Entity Key from not null columns.
To change Entity Key to the correct one you should change the key columns in designer and then go to Model Explorer and make the same changes in the Store part of the model.

Posted: Tue 28 Dec 2010 16:06
by keeper
Thanks that was exactly what I was looking for!