This discussion is archived
3 Replies Latest reply: Aug 27, 2012 2:18 PM by Christian.Shay - Oracle RSS

Bug in EF generator - ODTwithODAC112030

920337 Newbie
Currently Being Moderated
Hello,

I am using Oracle Developer tools for Visual Studio 2010 (ODTwithODAC112030) and when I generate/update the model from the database, I get the following error for some views: error 0075: Key Part: 'ID' for type MYVIEW is not valid. All parts of the key must be non nullable. Even if the build is fine, at runtime I get the same error.

The solution is to manually set Nullable = "false" in the schema (edmx file) which can be annoying when one updates the model frequently.

The bug is when I look at the ID in Properties pages (F4), the Nullable property is false but in the file the value is not present.

Edited by: 917334 on May 9, 2012 12:49 PM
  • 1. Re: Bug in EF generator - ODTwithODAC112030
    931836 Newbie
    Currently Being Moderated
    ID column in your view is defined as nullable. Make sure that you create the view in a way that this column is not nullable. ID should be a primary key in the original table and make sure that you do not do anything strange (like left join sometable where sometable has this ID column)
  • 2. Re: Bug in EF generator - ODTwithODAC112030
    938322 Newbie
    Currently Being Moderated
    I confirm this is a huge problem. I tried everything to let ODAC understand which are the primary key fields of my view: I created a disabled index on them, I put NVL statements in the view definition on each column, but still the EF model sees them as nullable fields. So I have to manually change them in the EDMX, but at the next update of the model I have to change it again, which is very very annoying....
  • 3. Re: Bug in EF generator - ODTwithODAC112030
    Christian.Shay - Oracle Pro
    Currently Being Moderated
    user12092119 wrote:
    I confirm this is a huge problem. I tried everything to let ODAC understand which are the primary key fields of my view: I created a disabled index on them, I put NVL statements in the view definition on each column, but still the EF model sees them as nullable fields. So I have to manually change them in the EDMX, but at the next update of the model I have to change it again, which is very very annoying....
    If the issue is that the column is listed as non-nullable in the properties pane but that is not making it to the EDMX file, this is probably just one is a series of similar bugs in VS2010.

    Here is the hotfix for a similar issue for StoreGeneratedPattern
    http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=37957

    My advice is to download Vs2012 and try it out with our new beta and see if the problem goes away