MapEngine
MapEngine

Reputation: 553

Can I reverse engineer UML Classes from SQL DDL in Enterprise Architect?

I need to generate some UML diagrams from my SQL snippets. Optimally I'd like a text box to paste my statements and get an UML diagram in return. Is that possible in EA? I looked around but couldn't find a way - every source I discovered is about the reverse process.

Basically,

From:

CREATE something (
ID INTEGER NOT NULL PRIMARY KEY,
date DATE NOT NULL,
comment VARCHAR(256) NOT NULL);

To: box that says the same

/edit: By box I mean a class diagram component, like here: http://www.icodeguru.com/design/Enterprise-Architect/classdiagram.png

Upvotes: 1

Views: 2149

Answers (2)

Uffe
Uffe

Reputation: 10514

You can drag text from an editor and drop it onto a diagram in EA. EA will then prompt you for an element type (Class, Component, etc) and create an element of that type with the text as its name.

Note that EA does not allow tabs or line breaks (hard or soft) in names. Tabs will be replaced with a single blank and only the part up until the first line break will be used as the name of the new element. Remaining lines will go into the element's notes.

You can set the diagram to display all notes sections, and you can fiddle around with the presentation settings a bit to change their color etc, but it'll never look like it does in an SQL editor.

It should also be noted that as far as UML goes, creating a diagram with classes representing bits of SQL is pure nonsense. UML has no representation for statements, and classes are not boxes.

Upvotes: 1

Geert Bellekens
Geert Bellekens

Reputation: 13784

Out of the box you cannot reverse engineer SQL DDL to UML classes.

You can reverse engineer a (part of) database schema through ODBC, but your database has to exist to be able to do that.

You can however write your own Grammar for SQL DDL to be able to reverse engineer it, but that is not for the faint-hearted.

Upvotes: 3

Related Questions