Views and not nullable columns

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 1
Joined: Mon 22 Dec 2008 11:06

Views and not nullable columns

Post by m.nijland » Mon 22 Dec 2008 11:18

I have a problem with Oracle views in EDM
It seems to me that columns that do not allow Nulls have the Entity Key automatically assigned to true. With the Entity key set I'm not able to update that column.
This problem does not occur when using the table instead of the view.
Using other Oracle clients (like TOAD) I'm able to change the data in the view.
Is there a way to update not nullable columns from Oracle views in EDM?

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

Post by AndreyR » Mon 22 Dec 2008 14:59

The entity key is generated for all tables and views by EDM Wizard. For the tables it is generated using the primary key. But views do not have primary keys, so the entity key is generated from all NOT NULL columns of a view. If some view has no NOT NULL columns, it will be excluded from the model. This feature of Entity Framework is needed for change tracking.
As a workaround you can manually modify the generated model using XML Editor to enable the update. In fact this is the only way.

Post Reply