title: Using Entity Framework with Oracle and Mapping Inheritance - Table-per-Type. Trigger updated Id is not being set in subclass table
body: <p>I am using Oracle with Entity Framework. The database ids are generated using triggers and sequences.</p>
  
  <p>I want to set up Table-per-Type inheritance, as described <a href="http://msdn.microsoft.com/en-us/library/cc716702.aspx" rel="nofollow">here</a>. I've set the "CourseId" to be StoreGeneratedPattern of "Identity".</p>
  
  <p>Everything seems to be fine, except when I insert a row. The table representing the base class (in the walkthrough linked above, the Course table) gets a generated ID as expected.</p>
  
  <p>However the table representing the inherited class (in the walkthrough linked above, the OnlineCourse table) has a row inserted with the CourseId set to zero. This violates the foreign key constraint.</p>
  
  <p>I assume it's something to do with the sequence of inserts. I imagine it should work like:</p>
  
  <ul>
  <li>Insert the Course row</li>
  <li>Retrieve the newly created CourseId value</li>
  <li>Insert the OnlineCourse, using the new CourseId</li>
  </ul>
  
  <p>However, this isn't working because it's just using the default value of the CourseId (zero) to insert into OnlineCourse.</p>
  
  <p>Any ideas how to fix this?</p>