Questions tagged [table-per-class]

Table per class or also called as "Table per concrete type" is a strategy used for mapping inherited entities supported by Entity Framework code first.

53 questions
0
votes
1 answer

NotSupportedException: The type A cannot be mapped as definede. Table per Concrete (TPC) EF6

I have model like: public abstract class Entity { public int Id { get; set; } } public abstract class Tree : Entity { public Tree() { Childs = new List(); } public int? ParentId { get; set; } …
Mohammadreza
  • 3,139
  • 8
  • 35
  • 56
0
votes
1 answer

EntityFramework Code First FluentAPI TPC

Here there are my domain entities: public class Province { private ICollection _cities; public virtual ICollection Cities { get { return _cities ?? (_cities = new HashSet()); } set { _cities = value; } …
0
votes
1 answer

Understanding of TABLE_PER_CLASS with keys in eclipselink

I have a simple Java EE 7 Web App with Eclipselink and the TABLE_PER_CLASS inheritance strategy. Following classes: @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Entity public abstract class AbstractService implements Serializable { …
0
votes
2 answers

eclipselink asking for class indicator field when using InheritanceType.TABLE_PER_CLASS

I already spend a few hours in trying to get that work. I'm using the history policy to create a full historization for some of my tables. This is defined in an abstract class. Then I have an normal entity implementing this class and defining it's…
RMM
  • 21
  • 4
0
votes
0 answers

Entity Framework TPC abstract identity issue

Came across a most odd error during model generation. Apparently, the following is allowed: public abstract class Entity { public string CreatedBy { get; set; } public string ModifiedBy { get; set; } } public class Car { public int CarId {…
Klue
  • 59
  • 7
0
votes
1 answer

NHibernate: Persisting subclassed entity to main table (table per class strategy issue)

It is not a question but just for future... (spent many time to figure out) public class A { public int Id { get; set; } public string Name { get; set; } public string Type { get; set; } } public class B : A { public string Lastname…
0
votes
1 answer

Entity Framework Table Per Concrete Type foreign key

I have the following class hierarchy public class A { public int Id { get; set; } public virtual IColection Items {get; set; } } public abstract class B { public int Id {get; set; } public A Parent {get; set; } } public class C :…
lostaman
  • 922
  • 12
  • 25
0
votes
1 answer

Hibernate Table Per Class & Set Mapping

I'll illustrate my issue with a contrived example to try and keep it as simple and easy to follow as possible. However my real issue is in legacy code and so I cannot change the schema or anything like that. I have a table per class hiarachy in my…
samblake
  • 1,517
  • 3
  • 16
  • 33
1 2 3
4