Skip to main content



      Home
Home » Modeling » EMF » EcoreUtil.getAnnotation: multiple annotations with same source
EcoreUtil.getAnnotation: multiple annotations with same source [message #431801] Mon, 27 July 2009 08:57 Go to next message
Eclipse UserFriend
Hi.

In CDO a structural feature can have multiple annotation with the same source, like:

<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/CDO/DBStore">
<details key="columnName" value="HOLY"/>
</eAnnotations>
<eAnnotations source="http://www.eclipse.org/CDO/DBStore">
<details key="columnType" value="CLOB"/>
</eAnnotations>
</eStructuralFeatures>

The problem with EcoreUtil.getAnnotation() now is that it always only checks the first annotation.
Shouldn't it check all annotations with that source if the key exists?

Regards,
Kai
Re: EcoreUtil.getAnnotation: multiple annotations with same source [message #431810 is a reply to message #431801] Mon, 27 July 2009 12:30 Go to previous message
Eclipse UserFriend
Kai,

While it's certainly possible to have more than one annotations with the
same source, it's not a good idea and the helper methods for accessing
annotations don't provide help for that pattern of usage. Obviously it
would be possible to have duplicate or conflicting mappings with such an
approach.


Kai Schlamp wrote:
> Hi.
>
> In CDO a structural feature can have multiple annotation with the same
> source, like:
>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http://www.eclipse.org/CDO/DBStore">
> <details key="columnName" value="HOLY"/>
> </eAnnotations>
> <eAnnotations source="http://www.eclipse.org/CDO/DBStore">
> <details key="columnType" value="CLOB"/>
> </eAnnotations>
> </eStructuralFeatures>
>
> The problem with EcoreUtil.getAnnotation() now is that it always only
> checks the first annotation.
> Shouldn't it check all annotations with that source if the key exists?
>
> Regards,
> Kai
Previous Topic:[CDO] Column name generation
Next Topic:Errorneous code generated
Goto Forum:
  


Current Time: Mon Jul 07 11:05:30 EDT 2025

Powered by FUDForum. Page generated in 0.06249 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top