Object-relational mapping (with associations/keys)
A simplified version of the object-relational mapping in EMF along with models demonstrating a solver-based approach to bidirectional transformation.
Description
The uml2rdbms_keys.qvtr transformation is a simplified version of the classical object-relational mapping, between class diagrams and database schemes, used as a running example in the QVT standard.
Every persistent Class on the UML class diagram is matched to a Table in the relational database scheme, with a Column for every Attribute, including those inherited from super-classes. Associations between classes are mapped to foreign keys.
Meta-models and models are specified in the Eclipse Modelling Framework (EMF), enhanced with OCL constraints.
The provided Alloy models provide an encoding of the class diagram and database schemes and of the QVT-r transformation, demonstrating a solver-based approach to bidirectional transformations. In these models, model distance is calculated with graph-edit distance. An instantiation for a particular transformation example, described below, is also provided.
Meta-models
| UML.ecore for UML class diagrams | RDBMS.ecore for relational database schemes |
|---|---|
![]() |
![]() |
Models
| UML_Company.xmi | RDB_Company.xmi |
|---|---|
![]() |
![]() |
Development history
- This example is a simplified version of the example illustrating the MOF 2.0 Query/View/Transformation Specification.
- This example has been used to illustrate the ASE'13 tool demo Model repair and transformation with Echo.
- A simplified version has been used to illustrate the SoSyM paper Least-change bidirectional model transformation with QVT-R and ATL, the FASE'13 paper Implementing QVT-R bidirectional model transformations using Alloy, and N. Macedo's PhD Thesis.
- Alloy models have been developed and analyzed under the Alloy Analyzer 4.2_2012-09-25, and subsequently tested for support under version 5.0.0.201804081720.
- Language: [Alloy] [Ecore] [QVT]
- Theme: [Synchronization] [Bidirectional Transformation] [MDE]
- Venue: [ASE13]



