We have an entity like Vehicle
and three derived entities such as Car
, Motorbike
and Bicycle
.
This inheritance hierarchy is implemented with TPH.
Here are entity mapping conditions:
__disc__ = car
for Car__disc__ = motorbike
for Motorbike__disc__ = bicycle
for BicycleHow can I derive another child from
Vehicle
likeMotorVehicle
with following mapping condition:__disc__ = car OR motorbike
for MotorVehicle
I'd view in Database like this when I had this structure with TPT:
SELECT Id
FROM Vehicles
WHERE (__Disc__ = N'car') OR (__Disc__ = N'motorbike')
I think this view is not required with TPH.
Please note that I can not change the inheritance like this: Vehicle<-- MotorVehicle<-- Car. Don't think about injecting the motor vehicles as the parent of car and other children because Car and Motorbike and Bicycle are already exists. I just want to assign some business to all motor vehicles.