Skip to main content


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 18:40 Go to next message
Ruben Faelens is currently offline Ruben FaelensFriend
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 18:49]

Report message to a moderator

Re: ExtendedMetadata unmapped structuralFeature [message #991579 is a reply to message #991567] Wed, 19 December 2012 19:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ExtendedMetadata unmapped structuralFeature [message #991969 is a reply to message #991579] Thu, 20 December 2012 15:14 Go to previous messageGo to next message
Ruben Faelens is currently offline Ruben FaelensFriend
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 15:21 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] Using the DB Mapping to populate queries
Next Topic:JSON Support
Goto Forum:
  


Current Time: Wed Apr 24 22:14:00 GMT 2024

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

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

Back to the top