Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Creating OrderBy annotation for OneToMany
Creating OrderBy annotation for OneToMany [message #1748966] Wed, 30 November 2016 14:55 Go to next message
Michael Wyraz is currently offline Michael WyrazFriend
Messages: 1
Registered: November 2016
Junior Member
Hello,

I use EMF to model my entities and texo the create JPA annotated classes. What I cannot model directly, I do with the annotation model. Up to now I could model everything I needed. Except the following:

@OneToMany(cascade = { CascadeType.ALL }, mappedBy = "parameters", orphanRemoval = true)
@OrderBy("id")
private Set<Parameter> parameters;

What I want: I'd like to query the list of parameters in the order they where inserted in the database. I don't want an extra table nor an OrderColumn. With plain JPA it works but I cannot make texo to add the @OrderBy annotation.

Is this possible? How?

Kind regards,
Michael Wyraz.
Re: Creating OrderBy annotation for OneToMany [message #1749161 is a reply to message #1748966] Fri, 02 December 2016 13:15 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Michael,
Yes it should be possible. What does get generated in the source code?

Another option/thing you can try is put the orderBy as a property of the OneToMany.

But when I check the source code it should work either way.

If you post the relevant part of the annotations model here then I can take a look and create a testcase for it also.

gr. Martin
Previous Topic:Validation on save
Next Topic:[CDO] First pass through resource contents slow?
Goto Forum:
  


Current Time: Tue Jun 15 07:53:39 GMT 2021

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

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

Back to the top