Faisal wrote:
Hi,
The 'CompanyCar' example is a very simple example of TargetPerEntityHierarchy inheritance, where all the columns of table are mapped to every involved object.
No, you have the HasDrawingHook, which isn't added to the sportscar and you have the IsCabrio field which isn't part of the familycar type.
There can be a situation where every derived object maps to different columns of the same table. I doubt, LLbLgen doesn't support this situation as it only asks for the descriminator column and not for other possible columns that no other derived object should have.
For example, we have a 'Payment' table that has columns
paymentid
amount
bankintrest
bankname
bankbranch
paymenttype.
Now I want three subtypes of object Payment { PaymentID, Amount}
1. CashPayment
2. CreditCardPayment {BankIntrest}
3. ChequePayment {BankName, BankBanch}
How would this be implemented?
Thanks
Faisal
In all cases the discriminator column has to be there. Otherwise how to determine which entity type the data represents? So paymenttype has to be part of every type. The rest is free for you to choose. (except the pk of course.) So I'm a little puzzled what the problem is.