| [QVTO] Nullable enumerations [message #481967] | 
Mon, 24 August 2009 18:02   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 enumerated 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
[Updated on: Mon, 24 August 2009 20:07] by Moderator  
 |  
 |  
  | 
| Re: [QVTO] Nullable enumerations [message #482154 is a reply to message #481967] | 
Tue, 25 August 2009 10:21    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: dvorak.radek.gmail.com 
 
Hi Alex, 
 
At the moment there is no direct support for this in QVTO. 
Could you please raise bugzilla so we can track this down 
 https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2M& component=QVT_OML-Engine 
 
Regards, 
/Radek 
 
 
On Tue, 25 Aug 2009 00:02:26 +0200, Alex <alex.leites@gmail.com> wrote: 
 
> 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
 |  
 |  
  | 
 | 
Powered by 
FUDForum. Page generated in 0.05000 seconds