Class model to ERD via ORM

Hi - I have been asked to investigate the possibility of creating a physical model from the class model that I have created for a project. Given that I know that I will need to flatten back a number of classes to a single table and I could not figure out how to do this last time I looked at it is there any detailed online help that I can consult?

Class model has upwards of 80 classes with a lot of association (visually for me it is better to have a class+association rather than an attribute+ implied association) but when I physicalize it I want to flatten it back to a single table.

Any help would be much appreciated - I already have the xsd’s being generated and am now at a point where the C# code is being generated so the DB is the next logical choice (joke intended!).

Many thanks

Toby

Hello Toby,

As you already defined the class model, you can simply synchronize it to ERD (right click on your class diagram and select Synchronize to ERD). Do you think this is what you need?

Note that all you classes should have ORM Persistable stereotype specified, and the synchronization is supported in Professional Edition or above of VP-UML/SDE, also all edition of DB-VA.

Best regards,
Rain

Hi Rain, thanks for that, I had forgotten how you did it…

I do have a question over the “Table per class / subclass / concrete” choice - I have a number of quite complex generalisations; normally about 4 or 5 levels before you reach the bottom of the tree. Can you provide additional documentation to let me know how I need to set this up to generate a table per bottom class?

In the example below Class C and Class E should become tables in the database with the other classes just being used to provide their attributes.

Logic tells me that it should be “Table Per concrete class” and to apply it to everything in the stack - so all classes have the same ORM Class Detail - is this right?

Many thanks

Toby

Class Diagram1.jpg

Hello Toby,

The table per concert class strategy will create table map to each concert class in your class model. But since our ORM engine will not take care the “interface” class, therefore all classes A - E will be map to tables. In order to have class A, B and D not map to table, you have to change them into ORM Abstract Persistable. With the ORM Abstract Persistable, they will not able to instantiate and therefore will not map to any table.

Feel free to contact me if you need any help.

Best regards,
Rain