QVTO
1 program
Added 2026-03-17T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: QVT-O, QVT Operational, QVT Operational Mappings
Provenance: commit 046a7c2b87 · authored 2026-03-17T03:18:55+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
UML Class Model to Relational Database Transformation
Provenance: commit 046a7c2b87 · authored 2026-03-17T03:18:55+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
-- QVT Operational (QVTO) transformation: UML Classes to Relational Tables
-- Classic UML2RDBMS example from the OMG QVT specification
transformation UML2RDBMS(in uml : UML, out rdb : RDB);
-- Map a persistent UML Class to a relational Table
mapping UML::Class::class2table() : RDB::Table
when { self.isPersistent = true }
{
name := self.name;
columns += self.attribute->map attribute2column();
key := self.attribute->select(a | a.isId)->map attribute2column();
}
-- Map a UML Attribute to a relational Column
mapping UML::Attribute::attribute2column() : RDB::Column {
name := self.name;
type := self.type.name;
}
-- Map a UML Association to a foreign-key Column
mapping UML::Association::assoc2foreignKey() : RDB::Column {
name := self.source.name.concat("_fk");
type := "INTEGER";
}
-- Main entry point: transform all persistent classes
main() {
uml.objectsOfType(UML::Class)->map class2table();
}