| Author |
Message |
|
2007/07/10 21:49
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Jick
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
Attached Image :
No description given
(13 kb)
Attached Image :
No description given
(14 kb)
Attached Image :
No description given
(4 kb)
|
|
|
|
 |
| |
|
2007/07/11 08:46
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hello Toby,
Please try:
1. Right-click on the Super class
2. Select Open Specification from the popup menu
3. Select ORM Class Detail
4. Press on Subclasses...
5. Select the SubClasses from the Inheritance Strategy dialog box
6. Set the strategy to be "Table per class hierarchy"
7. Press Apply
8. Confirm
9. Right-click on the diagram and select "Synchronize to Entity Relationship Diagram" from the popup menu
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/13 03:59
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Hi Jick,
I tried that (both options) and no joy. I have had it work on other projects but it seems to occur for some classes and not others randomly.
I have created a new project with three classes and tried it and I still get a single class or three separate classes...
Attached is the vpp file..
| Description |
|
Download
|
| Filesize |
18 kb
|
| Downloaded: |
114 time(s) |
|
|
|
|
 |
| |
|
2007/07/13 08:51
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
|
 |
| |
|
2007/07/13 17:35
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
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?
Attached Image :
Description : Class
(12 kb)
Attached Image :
Description : ERD
(19 kb)
|
|
|
|
 |
| |
|
2007/07/13 18:15
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
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.
Have a nice weekend!
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/16 11:37
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
I am sorry to say that we do not support this kind of mapping strategy at this moment.
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/16 15:41
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
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.
Attached Image :
Description : Schema
(4 kb)
Attached Image :
Description : Class
(8 kb)
Attached Image :
Description : ERD
(11 kb)
|
|
|
|
 |
| |