Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Overriding persistence behaviour of an EMF resource
Overriding persistence behaviour of an EMF resource [message #694035] Thu, 07 July 2011 16:59 Go to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Hi,

In EMF we have seen the attributes of the parent object get persisted first then the subclass attributes.
I am just taking XML as an use case.

During the save of any XML resource, I have seen the XMLSaveImpl saves the features of the classes.These features are retrieved by getEAllStructuralFeatures() of any EClass and this list is populated by putting the super type attributes first.
Same we see in the toString() implementation of any object.

Could these behaviour be somehow overriden or changed such that the sublcass attributes are persisted first ?.

cheers,
Saurav



[Updated on: Thu, 07 July 2011 17:00]

Report message to a moderator

Re: Overriding persistence of an EMF resource [message #694057 is a reply to message #694035] Thu, 07 July 2011 17:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Saurav,

Comments below.

On 07/07/2011 10:00 AM, saurav wrote:
> Hi,
>
> In EMF we have seen the attributes of the parent object get persisted
> first then the subclass attributes.
> I am just taking XML as an use case.
Generally they'll be done in the order in which they appear in
EClass.eAllStructuralFeatures.
>
> During the save of any XML resource, I have seen the XMLSaveImpl saves
> the features of the classes.These features are retrieved by
> getEAllStructuralFeatures() of any EClass and this list is populated
> by putting the super type attributes first.
Yep.
> Same we see in the toString() implementation of any object.
>
> Could these behaviour be somehow overriden or changed such that the
> sublcass attributes are persisted first ?.
No. Though you could specialize the Lookup.listFeatures in combination
with OPTION_USE_CACHED_LOOKUP_TABLE.
>
> cheers,
> Saurav
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Overriding persistence of an EMF resource [message #694180 is a reply to message #694057] Fri, 08 July 2011 03:04 Go to previous message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Hi Ed,

Many thanks for the reply.
I think OPTION_USE_CACHED_LOOKUP_TABLE can help me to some extent.

cheers,
SAurav


Previous Topic:get all contained objects by EReference name
Next Topic:org.eclipse.emf.cdo.transaction jar
Goto Forum:
  


Current Time: Fri Apr 19 20:17:31 GMT 2024

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

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

Back to the top