QVT Relations Language

Transformations
Relations
Queries
Model Element Identification
Importing and Extending Transformations
In-place Transformations
Traceability
Bidirectionality
Transaction
Random transformations
User operations

QVT Relations is a user friendly and compact language declaratively expressing the relations which must exist between model elements of source and target models. We will introduce the QVT 2.0 Relations language with the help of an example. In this example, we are going to express transformations between a simple UML class model and a simple relational database model, i.e. the Object/Relational mapping known from some frameworks like Hibernate. The next two figures show the SimpleUML and SimpleRDBMS MOF metamodels modeled by the medini meta modeler. We assume the reader knows how to interpret MOF Metamodels (see the medini MOF Guide).

Figure 2. SimpleUML Metamodel

SimpleUML Metamodel

Figure 3. SimpleRDBMS Metamodel

SimpleRDBMS Metamodel

The O/R mapping is defined with the following rules: