Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Influence order of n-ary references?
Influence order of n-ary references? [message #748204] Mon, 24 October 2011 14:59 Go to next message
Eclipse UserFriend
Is it possible to influence the order of the EList in which referenced
EObjects are saved? There is the attribute "ordered" but I don't know
how to specify the order. The best way would be to provide some kind of
comparator. Is that possible anyhow?

best regards,
Gilbert
Re: Influence order of n-ary references? [message #748357 is a reply to message #748204] Mon, 24 October 2011 16:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Gilbert,

Comments below.

On 24/10/2011 4:59 PM, Gilbert Mirenque wrote:
> Is it possible to influence the order of the EList in which referenced
> EObjects are saved?
They're saved in the order in which the appear in the list.
> There is the attribute "ordered" but I don't know
> how to specify the order.
That doesn't mean sorted. In theory we might deal with ordered and
unique by producing a Collection, Set, or List as appropriate, but in
practice, all multi-valued features are surfaced as lists. So ordered
just means the order in the list is semantically significant.
> The best way would be to provide some kind of
> comparator. Is that possible anyhow?
You can sort the list at any time using ECollections.sort (so that move
instead of add/remove are used).
>
> best regards,
> Gilbert


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Influence order of n-ary references? [message #749422 is a reply to message #748357] Tue, 25 October 2011 08:00 Go to previous message
Eclipse UserFriend
Hi Ed,

Ed Merks wrote:
> Gilbert,
>
> Comments below.
>
> On 24/10/2011 4:59 PM, Gilbert Mirenque wrote:
>> Is it possible to influence the order of the EList in which referenced
>> EObjects are saved?
> They're saved in the order in which the appear in the list.
>> There is the attribute "ordered" but I don't know
>> how to specify the order.
> That doesn't mean sorted. In theory we might deal with ordered and
> unique by producing a Collection, Set, or List as appropriate, but in
> practice, all multi-valued features are surfaced as lists. So ordered
> just means the order in the list is semantically significant.
>> The best way would be to provide some kind of
>> comparator. Is that possible anyhow?
> You can sort the list at any time using ECollections.sort (so that move
> instead of add/remove are used).
every post you write I learn something from it ;)
Thanks!

>>
>> best regards,
>> Gilbert
Previous Topic:ResourceSetImpl.demandCreateResource and URI normalization
Next Topic:CDO - Hibernate Store
Goto Forum:
  


Current Time: Thu Apr 25 10:34:45 GMT 2024

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

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

Back to the top