0

We need to import from a CSV file a SQL scheme as

  • SQL Tablel shall map to Class «Persistent Table»
  • SQL Columns shall map to Property «Column» with 'Propery.Type' set to SQL ANSI type

CSV columns: TAB_NAME; COL_NAME; COL_TYPE; COL_COMMENT

CSV record example: "MYTAB"; "COL1"; "char"; "Just an example"

CSV Import pass 1:

  • Import each TAB_NAME record as new Class of stereotype «Persistent Table»: ok, works fine

CSV Import pass 2: import each column as Property of stereotype «Column»

  • Owner is TAB_NAME: Ok
  • Name is COL-NAME: Ok, imported as property's name
  • Documentation of column is COL_COMMENT: Ok, imported as property's documentation
  • SQL Type of Column shall be COL_TYPE: produces an ERROR

No matter what we provide in the CSV column COL_TYPE, we get import errors for each record in the CSV file: e.g. "Could not find element char in com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.PackageImpl@e25070db."

For example for SQL type CHAR

  • CHAR --> error
  • char (what is element of the necessary type enumeration "ANSI SQL Type Library" of MagicDraw) --> error
  • String (what is an UML native type) --> Error "Feature type cannot find element String for mapping"

What can we do? Is it possible to provide an "inner mapping" form the string "char" to "SQL ANSI Type char" ?

karldegen
  • 113
  • 8

1 Answers1

0

The MagicDraw CSV Import Plugin is just not capable enough to be used in the intended way.

Because we have to import masses of data into MagicDraw, we decided to develop a plugin in Java ourselfs.

MagicDraw comes with enough examples for that. Maybe one hint can help you to overcome starting problems:

Do not start an older version of MagicDraw from within an older but matching version of Eclipse, even if the documentation tells so.

It is much easier to use a current Eclipse version with matching JDK version, produce a JAR file as result direct into the local MagicDraw installation (plugin folder) and then attach the Eclipse debugger remotely to the running MagicDraw application. Minor code changes are replaces inside your plugin at runtime. Structural changes need to restart MagicDraw.

karldegen
  • 113
  • 8