Table per Type Inheritance

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 5
Joined: Wed 27 Feb 2013 20:00

Table per Type Inheritance

Post by SchneiderM » Mon 06 May 2013 08:17

we are having a problem with EF 5.0 and Table per Type inheritance on Oracle.
We have a parent entity and multiple (3) derived entities.
When we try to load a child entity with Find() we got this exception:
System.InvalidOperationException: The specified cast from a materialized 'EntityFramework.Child' type to the 'EntityFramework.Child2' type is not valid.
at System.Data.Common.Internal.Materialization.Translator.CheckedConvert[TSource,TTarget](TSource value)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
at System.Data.Entity.Internal.Linq.InternalSet`1.FindInStore(WrappedEntityKey key, String keyValuesParamName)
at System.Data.Entity.Internal.Linq.InternalSet`1.Find(Object[] keyValues)
at System.Data.Entity.DbSet`1.Find(Object[] keyValues)
at EntityFramework.Program.Main() in ...\Program.cs:line 45
When we search the entity with First(), we aren't having any problems.
Any suggestions?


Devart Team
Posts: 8083
Joined: Thu 14 Aug 2008 12:44

Re: Table per Type Inheritance

Post by Shalex » Wed 15 May 2013 15:33

This is an Oracle Server problem: ... outer-join. Please try connecting to another version of Oracle Server.

Post Reply