Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ExtendedMetadata unmapped structuralFeature(Making sure a structuralFeature ends up in the XMLResource eObjectExtensionMap)
ExtendedMetadata unmapped structuralFeature [message #991567] Wed, 19 December 2012 13:40 Go to next message
Ruben Faelens is currently offline Ruben Faelens
Messages: 3
Registered: December 2012
Junior Member
I am working on backwards compatibility using Ecore2XML files. So far, this is going great.

However, I now have the following mapping:
OLD:
OldFoo
* feature1

NEW:
NewFoo
* feature1 (derived)
* feature2

MAPPING:
OldFoo           <-> NewFoo
OldFoo::feature1 <-> NewFoo::feature2
   UNMAPPED      <-> NewFoo::feature1


I expected OldFoo::feature1 to be mapped correctly to OldFoo::feature2. Instead, the ExtendedMetaData object tries to map NewFoo::feature1 first. Instead of marking it 'unmapped', a fallback maps it to OldFoo::feature1, based on similarity on containingClass and feature name.

How can I make the ExtendedMetadata execute the above mapping correctly?

[Updated on: Wed, 19 December 2012 13:49]

Report message to a moderator

Re: ExtendedMetadata unmapped structuralFeature [message #991579 is a reply to message #991567] Wed, 19 December 2012 14:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25744
Registered: July 2009
Senior Member
Ruben,

I see an override of
org.eclipse.emf.mapping.ecore2xml.util.Ecore2XMLExtendedMetaData.getType(EPackage,
String) but no overrides for getElement or getAttribute that would
actually look in the map...

On 19/12/2012 10:46 AM, Ruben Faelens wrote:
> I am working on backwards compatibility using Ecore2XML files. So far,
> this is going great.
>
> However, I now have the following mapping:
>
> OLD:
> OldFoo
> * feature1
>
> NEW:
> NewFoo
> * feature1 (derived)
> * feature2
>
> MAPPING:
> OldFoo <-> NewFoo
> OldFoo::feature1 <-> NewFoo::feature2
> UNMAPPED <-> NewFoo::feature1
>
>
> I expected OldFoo::feature1 to be mapped correctly to
> OldFoo::feature2. Instead, the ExtendedMetaData object tries to map
> NewFoo::feature1 first. Instead of marking it 'unmapped', a fallback
> maps it to OldFoo::feature1, based on similarity on containingClass
> and feature name.
>
> How can I make the ExtendedMetadata execute the above mapping correctly?
Re: ExtendedMetadata unmapped structuralFeature [message #991969 is a reply to message #991579] Thu, 20 December 2012 10:14 Go to previous messageGo to next message
Ruben Faelens is currently offline Ruben Faelens
Messages: 3
Registered: December 2012
Junior Member
Instead of using the ExtendedMetadata solution, I ended up modifying EcoreUtil.Copier to integrate with the Ecore2Ecore file.

This way, backwards compatibility is much more stable; it is not dependent on XML serialization options but just works.

Thank you for the help though.
Re: ExtendedMetadata unmapped structuralFeature [message #991974 is a reply to message #991969] Thu, 20 December 2012 10:21 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25744
Registered: July 2009
Senior Member
Ruben,

Yes, that's a nice way and it lets you do arbitrarily complex things...

On 20/12/2012 7:14 AM, Ruben Faelens wrote:
> Instead of using the ExtendedMetadata solution, I ended up modifying
> EcoreUtil.Copier to integrate with the Ecore2Ecore file.
>
> This way, backwards compatibility is much more stable; it is not
> dependent on XML serialization options but just works.
>
> Thank you for the help though.
Previous Topic:[CDO] Using the DB Mapping to populate queries
Next Topic:JSON Support
Goto Forum:
  


Current Time: Fri Apr 18 01:41:19 EDT 2014

Powered by FUDForum. Page generated in 0.04212 seconds