This explains how to do Gen Spec when we have disjoint Specialization classes, although it uses SQL Server. Note : MySQL now allows CHECK so we don't have to worry about that anymore.
I have a couple of queries though.
How can I update both the Super and Subclasses ? Here is what I have read till now : Create a view by doing an inner join of the Super Class with the Sub Class. Next I CANNOT update both the Super and the Sub Class with ONE insert. I need to insert the relevant parts of the tuple into the Super / Sub Classes SEPERATELY. So ONE tuple insert into the View which modifies BOTH the Super and the Sub Classes is NOT possible. For example, I would need to break down the tuple so that I insert first into the Super Class and then insert into the Sub Class. Is there not any other better way?
How do I enforce total participation of the Super Class with respect to the Sub Classes?
As suggested in the referred link, it says "That can be fixed by adding a constraint that the superclass's ids exist in a union of the ids in the subclass tables." How can I convert this into a trigger? After what operation should this trigger activate ? It is not clear to me.
- I am curious, how do I convert this into a Overlapping IsA Relationship. By this I mean ONE Superclass may be belonging to multiple Subclasses at the same time.