Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] OrderBy for OneToMany(OrderBy annotation not added)
[TEXO] OrderBy for OneToMany [message #1153084] Thu, 24 October 2013 11:18 Go to next message
Andy Carpenter is currently offline Andy Carpenter
Messages: 145
Registered: July 2009
Senior Member
I've set the orderBy property of a OneToMany annotation in my annotations model and am not getting an OrderBy annotation in my generated Java. I've had a quick look at the EReferenceORMAnnotator class and it looks like there is currently no way to order the contents of a retrieved list. Is this correct, or have I missed something?
Re: [TEXO] OrderBy for OneToMany [message #1153171 is a reply to message #1153084] Thu, 24 October 2013 12:25 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5334
Registered: July 2009
Senior Member
Hi Andy,
If you manually set an orderBy it should normally be transferred to the annotation in java, the EReferenceORMAnnotator
only adds an orderby if needed but does not unset it.

Can you remove the OneToMany annotation manually from the source file? And then regenerate it.
There is a change that indeed orderBy does not work in combination with lists. With list implementations the order is
normally defined by the list index, so the order in which the application places objects in the list.

If you generate the orm.xml do you see the orderby correctly there?

If you have a small testmodel showing the issue then please enter a bugzilla and I can take a look at it.

gr. Martin

On 10/24/2013 01:18 PM, Andy Carpenter wrote:
> I've set the orderBy property of a OneToMany annotation in my annotations model and am not getting an OrderBy annotation
> in my generated Java. I've had a quick look at the EReferenceORMAnnotator class and it looks like there is currently no
> way to order the contents of a retrieved list. Is this correct, or have I missed something?


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Get all EClasses of a model
Next Topic:[EMF Store] update project programatically
Goto Forum:
  


Current Time: Mon Sep 22 22:32:12 GMT 2014

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

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