I have a weird problem. Given the following class diagram which generates the following XSD why does the ORM decide to stick all the attributes into the superclass?
If I reverse the generalization then it generates the correct ERD but then the XSD is reversed.
Any thoughts?
Thanks in advance
Toby Class Diagram1.jpg Entity Relationship Diagram1.jpg pic.png
Hi Jick - just downloading the newer version for my other problem…
This one may be my understanding that is at fault…
In the above diagram, class A could (and should) be an interface; it should never be implemented as a physical class. My expectation would be that via generalization the two attributes would propagate to the subclasses.
A real-life example: I am modelling a number of lookup tables (eye colour, hair colour etc). Each lookup table has four attributes: ID (int), Text(varchar(255), Effective From(date) and Effective To (date). I would like to have a superclass which has the repeatable attributes and in the subclass only have the relevant attributes.
The class & ERD diagrams should look like below.
I have managed to achieve the desired result but it seems not to work now.
Any ideas? Class Diagram1.jpg Entity Relationship Diagram1.jpg
Thank you for your explanation. I have passed your request onto our team for further feasibility studies. Once there is a feedback, I will get back to you.
Thanks Jick - oddly enough, it works when there is only one class in the chain but in reverse!
What I find a bit weird (may be a bug) is that when you generate an ERD from the diagram you end up with the superclass being generated not the subclass which is the exact opposite to what would be expected.
Take a look at the following diagrams:
The first is a basic two class model with generalisation.
The second is what happens when you InstantReverse to a XSD
The third is what happens when you sync to ERD.
The first two do what I would expect, the ERD looks to be the inverse of what is expected; the super and sub classes have reversed. XSD.png Class Diagram1.jpg Entity Relationship Diagram1.jpg