Page 1 of 1

Views and not nullable columns

Posted: Mon 22 Dec 2008 11:18
by m.nijland
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?

Posted: Mon 22 Dec 2008 14:59
by AndreyR
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.