table-per-hierarchy

Unable set table mapping to Boolean = False

Hello folks! I am trying to set an inheritance in Entity-Framework, I want to set the mapping when BooleanColumn = True. I am unable to do so. ...

Entity Framework TPH with multiple abstract inheritance

I'm trying to do a Table Per Hierarchy model in Entity Framework(VS 2008 sp1, 3.5). Most of my models have been very simple, an abstract type with multiple sub-types that inherit from it. However, I've been struggling with this latest challenge. I have STUDENTS that I'd like to inherit from PERSONS(abstract) that should inherity from ...

Multiple Inheritance with Entity Framework with TPH

Further to this question: http://stackoverflow.com/questions/1877411/entity-framework-tph-with-multiple-abstract-inheritance and VS.2008 sp1 .net 3.5 c# I decided to add Organizations and a School. Organization(abstract) inherits from Party, and School(concrete) inherits from Organization. I get the error: Error 1 Error 3034: Pr...

How to specify a mixed table-per-subclass -> table-per-hierarchy in NHibernate HBM?

I'm mixing table mapping strategies to store a class hierarchy via NHibernate 2.1.2. I'm not using Fluent NHibernate. I understand how to map a table-per-hierarchy -> table-per-subclass structure, but not the other way around, as the XML is invalid after adding the discriminator. Here's the HBM extract: <class name="Base1" table="Ba...

Table-per-hierarchy and inheritance implementation issue

I am migrating an old ASP application to a modern .NET version, to cut down on development times we are looking at the .NET 4.0 Entity Framework. However, we seem to have hit a brick wall in our development with this issue. Given is a small part of our database: A table OBJECT which contains a list of cars and their respective propertie...

How to map inheritance with property returned other inheritance?

Hi I have abstract class Vehicle and two classes that derive from: Car and ForkLift. public abstract class Vehicle { public EngineBase Engine { get; set; } } public class Car : Vehicle { public GasEngine Engine { get; set; } } public class ForkLift : Vehicle { public ElectricEngine Engine { get; set; } } and Engine clas...

Is it bad practice to use DiscriminatorFormula for migration of Hibernate databases?

I have an application using Hibernate for data persistence, with Spring on top (for good measure). Until recently, there was one persistent class in the application, A: @Entity public class A { @Id @Column(unique = true, nullable = false, updatable = false) @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; ...

Entity Framework table per hierarchy error 3034

I have an Entity Framework model using table per hierarchy. The base class is abstract and there are two derived classes. I want to create associations between these two derived classes and another class. These are many-to-many relations so go through a joining table. Adding the first association is ok, but when I add the second i get ...