We need to import from a CSV file a SQL scheme as
- Table 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-TYPE: 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: 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" ?