Java Reference
In-Depth Information
self .dataType2columns( self )-> select (isPrimaryKey)->
collect (c | object RDB::TableColumn {
name := prefix + '_' + c.name;
domain := c.domain;
type := object RDB::datatypes::PrimitiveDataType {
name := c.type.name;
};
isPrimaryKey := leaveIsPrimaryKey
})->asOrderedSet()
}
query UML::Property::isIdentifying() : Boolean {
stereotype->includes('identifying')
}
mapping UML::Class::class2primaryKey() : RDB::constraints::PrimaryKey {
name := 'PK' + self .name;
includedColumns :=
self . resolveoneIn (UML::Class::persistentClass2table,
RDB::Table).getPrimaryKeyColumns()
}
The final mapping for our data types to columns is the association
Attributes2columns() query. First, attributes that are persistent association
types are selected. Columns that are mapped to columns are collected and
returned as an ordered set.
query UML::DataType::assosiationAttributes2columns(targetType :
UML::DataType) : OrderedSet (RDB::TableColumn) {
self .attributes-> select (isAssosiation())->
collect (type.asDataType().dataType2columns(targetType))
->asOrderedSet()
}
query UML::Property::isAssosiation() : Boolean {
type. oclIsKindOf (UML::DataType) and not type.isPersistent()
}
13.9 Summary
In this chapter, we explored the QVT Operational Mapping Language in detail, as
supported by the current release of the M2M QVTO component. Improved sup-
port of the Operational language is expected, along with the introduction of sup-
port for the Relations language in subsequent releases. In the next chapter, we take
a deeper look at the Xpand template language for model-to-text transformation.
 
Search WWH ::




Custom Search