[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] [QVTO] Nullable enumerations

Is there any way QVT could directly support EMF/Ecore nullable enumerations pattern? Currently assigning to an attribute using this pattern in QVT requires additional cast of the EnumLiteral being assinged to the "wrapper" EDataType ...

Some background: There appears to be a standard EMF/Ecore pattern for nullable enumerations (enumerations that can have a null value in addition to their null values) - using an additional "wrapper" EDataType as a type for an attribute, linked to the appropriate EEnum via ExtendedMetadata annotation. This patterns is used by XSD-derived Ecore models, and is frequently referred to as pattern of choice for this kind of thing on EMF forums.  (The only alternative is to introduce a special NULL EnumLiteral into each nullable enum.)

This should only take a check for relationship between EDataType and enumeration literal for the assignment. Admittedly, this would have to reach into Ecore annotations, which is somewhat unusual I assume for QVT compiler, but the pattern appears to be common enough and important enough to justify supporting it directly...

Thank you,
Alex