Wrong Entity Key from Oracle View

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
keeper
Posts: 17
Joined: Mon 27 Dec 2010 09:20

Wrong Entity Key from Oracle View

Post by keeper » Tue 28 Dec 2010 13:01

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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 28 Dec 2010 13:30

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.

keeper
Posts: 17
Joined: Mon 27 Dec 2010 09:20

Post by keeper » Tue 28 Dec 2010 16:06

Thanks that was exactly what I was looking for!

Post Reply