-
1. Re: Inheritance
fcousin Mar 10, 2009 1:50 PM (in response to praveenvanga)Hi,
I had a similar problem, and I solved it :
In this example, I implemented the
Single_table
strategy, then thejoined
strategy : it is the strategy in which you define all the common attributes on table, and you join it with the child table :
For example, you would have one table 'payment' with all the common field (payment_id, date...) , one table 'cheque' (payment_id, cheque_number), one table 'credit card' (payment_id, card_number...). And a foreign key from cheque to payment (on the payment_id field), one foreign key from credit_card to payment, etc...I do not understand which strategy you want to implement (joined, or table per class ?). But if you want to implement the table per class 1 strategy, I suppose it is not very different...
1. table per class is when you define one table for each concrete class. In you example, if your program wants to retrieve all the payments, it makes unions to retrieve all information.