Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EcoreUtil.getAnnotation: multiple annotations with same source
EcoreUtil.getAnnotation: multiple annotations with same source [message #431801] Mon, 27 July 2009 12:57 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
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 16:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30685
Registered: July 2009
Senior Member
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: Fri Dec 06 18:51:15 GMT 2019

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

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

Back to the top