Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Problems with eAnnotation
[CDO] Problems with eAnnotation [message #645304] Thu, 16 December 2010 14:40 Go to next message
Stephane Rousseau is currently offline Stephane RousseauFriend
Messages: 34
Registered: September 2010
Member
Hello every one,

As said in the subject, I have problems managing eAnnotation in my ecore
metamodel with CDO.

I have an ecore metamodel. In this metamodel, I have one eAnnotation per
eClassifier for documentation purpose :

<eClassifiers xsi:type="ecore:EClass" name="MyFirstClass"
eSuperTypes="#//ModelElement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="a Class"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute"
name="myFirstAttribute" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>

I used the tutoriual here
( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F)
to have my ecore + CDO metamodel

After reading my xmi file, at the commit time, I have this exception in
mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange) method :

throw new IllegalStateException("range.size() != metaIDRange.size()");

The difference is the sum of eAnnotation occurrences and
eStringToStrigMapEntity occurrences.

If I remove the eAnnnotation from my ecore metamodel, I have no more the
error.

So, I wonder if I make something wrong (not impossible at all) or is
there any bug around this ?

Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809

Regards

Stephane Rousseau
Re: [CDO] Problems with eAnnotation [message #645309 is a reply to message #645304] Thu, 16 December 2010 14:58 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030205080302010901000909
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Stephane,

It seems to me you don't have a problem caused by annotations but rather a problem with modelevolution, which is generally not yet supported by CDO. Adding anything, including annotations, to a model results in a different model, an evolved model. I expect to come up with a solution to this complex problem in the first quarter of 2011.

In the meatime you'de have to migrate your existing data manually, possibly with the brand new export/import feature:

330235: Backup/Restore Functionality
https://bugs.eclipse.org/bugs/show_bug.cgi?id=330235

332355: Provide OSGi console commands to start/stop/list/export/import repositories
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332355

332428: CDO Export does not support custom datatypes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332428

Just the other second I answered some related questions of a customer. Please find an excerpt attached.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 16.12.2010 15:40, schrieb Stephane Rousseau:
> Hello every one,
>
> As said in the subject, I have problems managing eAnnotation in my ecore metamodel with CDO.
>
> I have an ecore metamodel. In this metamodel, I have one eAnnotation per eClassifier for documentation purpose :
>
> <eClassifiers xsi:type="ecore:EClass" name="MyFirstClass" eSuperTypes="#//ModelElement">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="a Class"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="myFirstAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>
> I used the tutoriual here ( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F) to have my ecore + CDO metamodel
>
> After reading my xmi file, at the commit time, I have this exception in mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange) method :
>
> throw new IllegalStateException("range.size() != metaIDRange.size()");
>
> The difference is the sum of eAnnotation occurrences and eStringToStrigMapEntity occurrences.
>
> If I remove the eAnnnotation from my ecore metamodel, I have no more the error.
>
> So, I wonder if I make something wrong (not impossible at all) or is there any bug around this ?
>
> Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809
>
> Regards
>
> Stephane Rousseau

--------------030205080302010901000909
Content-Type: text/plain;
name="mail.txt"
Content-Transfer-Encoding: base64
Content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BoYXZl IGEgcmVmZXJl
bmNlIGZyb20gYSBNYXJrZXRhYmxlUHJvZHVjdCB0byBhbiBFQ2xhc3MpIHRo ZW4geW91IG5l
ZWQgdG8gbWlncmF0ZSB0aGVzZSB0YXJnZXQgSURzIGFjY29yZGluZyB0byB0 aGUgbmV3IHJh
bmdlcy4NCg0KSSdtIGN1cnJlbnRseSBpbiBhIGRpc2N1c3Npb24gd2l0aCBt eSB0ZWFtIHdo
ZXRoZXIgd2Ugc2hvdWxkIGNvbnNpZGVyIHRoZXNlIE1ldGEgSUQgdGhpbmdz IGFuIGltcGxl
bWVudGF0aW9uIGRldGFpbCBpbiB0aGUgc2NvcGUgb2YgdGhlIGltcG9ydC9l eHBvcnQgbWVj
aGFuc2ltLiBUaGVyZSdzIGEgY2hhbmNlIHRoYXQgd2UgY2FuIHJlbW92ZSB0 aGlzIHR5cGUg
b2YgaW5mb3JtYXRpb24gZnJvbXRoZSBleHBvcnQgZmlsZSBhbmQgcmVwbGFj ZSB5b3VyIG93
biBNZXRhIElEIHJlZmVyZW5jZXMgYnkgbm9ybWFsIEVNRiBwcm94eSBVUklz IGludG8gdGhl
IHJlc3BlY3RpdmUgbWV0YSBtb2RlbHMuIFRoaXMgZGlzY3Vzc2lvbiBpcyBu b3QgZmluaXNo
ZWQsIHlldC4NCg0KU29ycnksIEkga25vdyB0aGlzIGlzIGEgbG90IG9mIHN0 dWZmIHRvIGNv
bnNpZGVyIGZvciB5b3UsIGJ1dCBJJ3ZlIG5ldmVyIHN1Z2dlc3RlZCB0aGF0 IHRoaXMgZXhw
b3J0L2ltcG9ydCBtZWNoYW5zaW0gaXN0IHRoZSAqYmVzdCogc29sdXRpb24g dG8gbW9kZWwg
ZXZvbHV0aW9uLiA=
--------------030205080302010901000909--


Re: [CDO] Problems with eAnnotation [message #645313 is a reply to message #645309] Thu, 16 December 2010 15:08 Go to previous messageGo to next message
Stephane Rousseau is currently offline Stephane RousseauFriend
Messages: 34
Registered: September 2010
Member
Thank you for your quick answer, Eike,

Before making the post, I read some posts about model evolution. But I
think it's not my case.

The xmi file is conformed to the ecore metamodel with annotation even if
there is no annotation in my xmi file.

The only evolution I've made is to remove eAnnotation from the ecore
metamodel to complete the commit.

I will read your links to see if the situations are the same, and for my
personal information too.

Regards

Stephane


On 16/12/2010 15:58, Eike Stepper wrote:
> Hi Stephane,
>
> It seems to me you don't have a problem caused by annotations but rather
> a problem with modelevolution, which is generally not yet supported by
> CDO. Adding anything, including annotations, to a model results in a
> different model, an evolved model. I expect to come up with a solution
> to this complex problem in the first quarter of 2011.
>
> In the meatime you'de have to migrate your existing data manually,
> possibly with the brand new export/import feature:
>
> 330235: Backup/Restore Functionality
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=330235
>
> 332355: Provide OSGi console commands to start/stop/list/export/import
> repositories
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332355
>
> 332428: CDO Export does not support custom datatypes
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332428
>
> Just the other second I answered some related questions of a customer.
> Please find an excerpt attached.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 16.12.2010 15:40, schrieb Stephane Rousseau:
>> Hello every one,
>>
>> As said in the subject, I have problems managing eAnnotation in my
>> ecore metamodel with CDO.
>>
>> I have an ecore metamodel. In this metamodel, I have one eAnnotation
>> per eClassifier for documentation purpose :
>>
>> <eClassifiers xsi:type="ecore:EClass" name="MyFirstClass"
>> eSuperTypes="#//ModelElement">
>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>> <details key="documentation" value="a Class"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>> name="myFirstAttribute" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>
>> I used the tutoriual here
>> ( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F)
>> to have my ecore + CDO metamodel
>>
>> After reading my xmi file, at the commit time, I have this exception
>> in mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange)
>> method :
>>
>> throw new IllegalStateException("range.size() != metaIDRange.size()");
>>
>> The difference is the sum of eAnnotation occurrences and
>> eStringToStrigMapEntity occurrences.
>>
>> If I remove the eAnnnotation from my ecore metamodel, I have no more
>> the error.
>>
>> So, I wonder if I make something wrong (not impossible at all) or is
>> there any bug around this ?
>>
>> Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809
>>
>> Regards
>>
>> Stephane Rousseau
Re: [CDO] Problems with eAnnotation [message #645314 is a reply to message #645309] Thu, 16 December 2010 15:15 Go to previous messageGo to next message
Stephane Rousseau is currently offline Stephane RousseauFriend
Messages: 34
Registered: September 2010
Member
Just one more thing,

I commit into a new database after each reading so the database is
always consistent with the metamodel.

Stephane

On 16/12/2010 15:58, Eike Stepper wrote:
> Hi Stephane,
>
> It seems to me you don't have a problem caused by annotations but rather
> a problem with modelevolution, which is generally not yet supported by
> CDO. Adding anything, including annotations, to a model results in a
> different model, an evolved model. I expect to come up with a solution
> to this complex problem in the first quarter of 2011.
>
> In the meatime you'de have to migrate your existing data manually,
> possibly with the brand new export/import feature:
>
> 330235: Backup/Restore Functionality
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=330235
>
> 332355: Provide OSGi console commands to start/stop/list/export/import
> repositories
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332355
>
> 332428: CDO Export does not support custom datatypes
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332428
>
> Just the other second I answered some related questions of a customer.
> Please find an excerpt attached.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 16.12.2010 15:40, schrieb Stephane Rousseau:
>> Hello every one,
>>
>> As said in the subject, I have problems managing eAnnotation in my
>> ecore metamodel with CDO.
>>
>> I have an ecore metamodel. In this metamodel, I have one eAnnotation
>> per eClassifier for documentation purpose :
>>
>> <eClassifiers xsi:type="ecore:EClass" name="MyFirstClass"
>> eSuperTypes="#//ModelElement">
>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>> <details key="documentation" value="a Class"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>> name="myFirstAttribute" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>
>> I used the tutoriual here
>> ( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F)
>> to have my ecore + CDO metamodel
>>
>> After reading my xmi file, at the commit time, I have this exception
>> in mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange)
>> method :
>>
>> throw new IllegalStateException("range.size() != metaIDRange.size()");
>>
>> The difference is the sum of eAnnotation occurrences and
>> eStringToStrigMapEntity occurrences.
>>
>> If I remove the eAnnnotation from my ecore metamodel, I have no more
>> the error.
>>
>> So, I wonder if I make something wrong (not impossible at all) or is
>> there any bug around this ?
>>
>> Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809
>>
>> Regards
>>
>> Stephane Rousseau
Re: [CDO] Problems with eAnnotation [message #645332 is a reply to message #645313] Thu, 16 December 2010 15:40 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.12.2010 16:08, schrieb Stephane Rousseau:
> Thank you for your quick answer, Eike,
>
> Before making the post, I read some posts about model evolution. But I think it's not my case.
And I think it is :P

> The xmi file is conformed to the ecore metamodel with annotation even if there is no annotation in my xmi file.
A particular persistence mechanism is always free to consider particular model evolutions as compatible or not, or even try to implicitely migrate instances during load or save. The following assertion is false:

(instance conforms to model1 and instance conforms to model2) implies model1 == model2

>
> The only evolution I've made is to remove eAnnotation from the ecore metamodel
There we go!

> to complete the commit.
>
> I will read your links to see if the situations are the same, and for my personal information too.
Please also understand that for certain persistence formats like XML or XMI it is just easier to cope with compatible evolution. While other formats like SQL tables are way harder to adjust. In the case of CDO there's even not a single implied format because custom data backends can be plugged into the framework.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Regards
>
> Stephane
>
>
> On 16/12/2010 15:58, Eike Stepper wrote:
>> Hi Stephane,
>>
>> It seems to me you don't have a problem caused by annotations but rather
>> a problem with modelevolution, which is generally not yet supported by
>> CDO. Adding anything, including annotations, to a model results in a
>> different model, an evolved model. I expect to come up with a solution
>> to this complex problem in the first quarter of 2011.
>>
>> In the meatime you'de have to migrate your existing data manually,
>> possibly with the brand new export/import feature:
>>
>> 330235: Backup/Restore Functionality
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=330235
>>
>> 332355: Provide OSGi console commands to start/stop/list/export/import
>> repositories
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332355
>>
>> 332428: CDO Export does not support custom datatypes
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332428
>>
>> Just the other second I answered some related questions of a customer.
>> Please find an excerpt attached.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 16.12.2010 15:40, schrieb Stephane Rousseau:
>>> Hello every one,
>>>
>>> As said in the subject, I have problems managing eAnnotation in my
>>> ecore metamodel with CDO.
>>>
>>> I have an ecore metamodel. In this metamodel, I have one eAnnotation
>>> per eClassifier for documentation purpose :
>>>
>>> <eClassifiers xsi:type="ecore:EClass" name="MyFirstClass"
>>> eSuperTypes="#//ModelElement">
>>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>>> <details key="documentation" value="a Class"/>
>>> </eAnnotations>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>>> name="myFirstAttribute" eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>
>>> I used the tutoriual here
>>> ( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F)
>>> to have my ecore + CDO metamodel
>>>
>>> After reading my xmi file, at the commit time, I have this exception
>>> in mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange)
>>> method :
>>>
>>> throw new IllegalStateException("range.size() != metaIDRange.size()");
>>>
>>> The difference is the sum of eAnnotation occurrences and
>>> eStringToStrigMapEntity occurrences.
>>>
>>> If I remove the eAnnnotation from my ecore metamodel, I have no more
>>> the error.
>>>
>>> So, I wonder if I make something wrong (not impossible at all) or is
>>> there any bug around this ?
>>>
>>> Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809
>>>
>>> Regards
>>>
>>> Stephane Rousseau
>


Re: [CDO] Problems with eAnnotation [message #645333 is a reply to message #645314] Thu, 16 December 2010 15:46 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.12.2010 16:15, schrieb Stephane Rousseau:
> Just one more thing,
>
> I commit into a new database after each reading so the database is always consistent with the metamodel.
Well, that indeed doesn't sound like a model evolution problem then, because from the point of the new repository it's just the first and only version.

It rather sounds like a deployment problem on your server. Please note that the package registry of a CDO repository by default consults the global EMF package registry before it attempts to create a dynamic package from the stored information about the originally committed package. In other words, generated packages have precedence.

It seems that you have old package versions registered in your global EMF package registry, Older and different from the ones deployed to and used by your clients.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Stephane
>
> On 16/12/2010 15:58, Eike Stepper wrote:
>> Hi Stephane,
>>
>> It seems to me you don't have a problem caused by annotations but rather
>> a problem with modelevolution, which is generally not yet supported by
>> CDO. Adding anything, including annotations, to a model results in a
>> different model, an evolved model. I expect to come up with a solution
>> to this complex problem in the first quarter of 2011.
>>
>> In the meatime you'de have to migrate your existing data manually,
>> possibly with the brand new export/import feature:
>>
>> 330235: Backup/Restore Functionality
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=330235
>>
>> 332355: Provide OSGi console commands to start/stop/list/export/import
>> repositories
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332355
>>
>> 332428: CDO Export does not support custom datatypes
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332428
>>
>> Just the other second I answered some related questions of a customer.
>> Please find an excerpt attached.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 16.12.2010 15:40, schrieb Stephane Rousseau:
>>> Hello every one,
>>>
>>> As said in the subject, I have problems managing eAnnotation in my
>>> ecore metamodel with CDO.
>>>
>>> I have an ecore metamodel. In this metamodel, I have one eAnnotation
>>> per eClassifier for documentation purpose :
>>>
>>> <eClassifiers xsi:type="ecore:EClass" name="MyFirstClass"
>>> eSuperTypes="#//ModelElement">
>>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>>> <details key="documentation" value="a Class"/>
>>> </eAnnotations>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>>> name="myFirstAttribute" eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>
>>> I used the tutoriual here
>>> ( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F)
>>> to have my ecore + CDO metamodel
>>>
>>> After reading my xmi file, at the commit time, I have this exception
>>> in mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange)
>>> method :
>>>
>>> throw new IllegalStateException("range.size() != metaIDRange.size()");
>>>
>>> The difference is the sum of eAnnotation occurrences and
>>> eStringToStrigMapEntity occurrences.
>>>
>>> If I remove the eAnnnotation from my ecore metamodel, I have no more
>>> the error.
>>>
>>> So, I wonder if I make something wrong (not impossible at all) or is
>>> there any bug around this ?
>>>
>>> Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809
>>>
>>> Regards
>>>
>>> Stephane Rousseau
>


Re: [CDO] Problems with eAnnotation [message #645493 is a reply to message #645333] Fri, 17 December 2010 13:25 Go to previous message
Stephane Rousseau is currently offline Stephane RousseauFriend
Messages: 34
Registered: September 2010
Member
Hello,

As I am in the prototyping part, I will not spend much time to see where
the problem comes from.

So I will be back with my problem in some weeks (in 2011).

Happy new year.

Stephane
On 16/12/2010 16:46, Eike Stepper wrote:
> Am 16.12.2010 16:15, schrieb Stephane Rousseau:
>> Just one more thing,
>>
>> I commit into a new database after each reading so the database is
>> always consistent with the metamodel.
> Well, that indeed doesn't sound like a model evolution problem then,
> because from the point of the new repository it's just the first and
> only version.
>
> It rather sounds like a deployment problem on your server. Please note
> that the package registry of a CDO repository by default consults the
> global EMF package registry before it attempts to create a dynamic
> package from the stored information about the originally committed
> package. In other words, generated packages have precedence.
>
> It seems that you have old package versions registered in your global
> EMF package registry, Older and different from the ones deployed to and
> used by your clients.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Stephane
>>
>> On 16/12/2010 15:58, Eike Stepper wrote:
>>> Hi Stephane,
>>>
>>> It seems to me you don't have a problem caused by annotations but rather
>>> a problem with modelevolution, which is generally not yet supported by
>>> CDO. Adding anything, including annotations, to a model results in a
>>> different model, an evolved model. I expect to come up with a solution
>>> to this complex problem in the first quarter of 2011.
>>>
>>> In the meatime you'de have to migrate your existing data manually,
>>> possibly with the brand new export/import feature:
>>>
>>> 330235: Backup/Restore Functionality
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=330235
>>>
>>> 332355: Provide OSGi console commands to start/stop/list/export/import
>>> repositories
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332355
>>>
>>> 332428: CDO Export does not support custom datatypes
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332428
>>>
>>> Just the other second I answered some related questions of a customer.
>>> Please find an excerpt attached.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 16.12.2010 15:40, schrieb Stephane Rousseau:
>>>> Hello every one,
>>>>
>>>> As said in the subject, I have problems managing eAnnotation in my
>>>> ecore metamodel with CDO.
>>>>
>>>> I have an ecore metamodel. In this metamodel, I have one eAnnotation
>>>> per eClassifier for documentation purpose :
>>>>
>>>> <eClassifiers xsi:type="ecore:EClass" name="MyFirstClass"
>>>> eSuperTypes="#//ModelElement">
>>>> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
>>>> <details key="documentation" value="a Class"/>
>>>> </eAnnotations>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>>>> name="myFirstAttribute" eType="ecore:EDataType
>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>>
>>>> I used the tutoriual here
>>>> ( http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#What.27s_the_b est_way_to_convert_an_XMIResource_to_a_CDOResource.3F)
>>>>
>>>> to have my ecore + CDO metamodel
>>>>
>>>> After reading my xmi file, at the commit time, I have this exception
>>>> in mapMetaInstances(EPackage ePackage, CDOIDMetaRange metaIDRange)
>>>> method :
>>>>
>>>> throw new IllegalStateException("range.size() != metaIDRange.size()");
>>>>
>>>> The difference is the sum of eAnnotation occurrences and
>>>> eStringToStrigMapEntity occurrences.
>>>>
>>>> If I remove the eAnnnotation from my ecore metamodel, I have no more
>>>> the error.
>>>>
>>>> So, I wonder if I make something wrong (not impossible at all) or is
>>>> there any bug around this ?
>>>>
>>>> Here is my environment : Eclipse SDK 3.7.0 + CDO 4.0.0.v20101108-0809
>>>>
>>>> Regards
>>>>
>>>> Stephane Rousseau
>>
Previous Topic:[EMF compare]
Next Topic:[EMF compare] An Extensible Framework
Goto Forum:
  


Current Time: Fri Apr 19 15:10:40 GMT 2024

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

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

Back to the top