This sample transforms a UML model into a Relational model, and then generates SQL table creation scripts.
|
Here is an example of a UML transformation launch:

| Feature | Example | Location | Reference |
| Calling an external rule | @UML2Relational(source, target).main() |
TransformAndGenerate.mqr |
rule call |
| Calling a text template from a rule | $GenerateSQL(target) |
TransformAndGenerate.mqr |
template call |
| Creating an instance | target.create("Table") |
UML2Relational.mqr |
Model APIs |
| Using subrules | rule createTable::createColumnAttribute() |
UML2Relational.mqr |
rule |
| Using transient links | dataType#coref.add(type) |
UML2Relational.mqr |
transient links |
| Specifying a default value | sqlType = column.type.name ? "VARCHAR(255)" |
GenerateSQL.tgt |
default value |