@OneToMany - Return Order

View: New views
3 Messages — Rating Filter:   Alert me  

@OneToMany - Return Order

by RogerV :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Is it possible to define the return order when a parent entity calls getChildren() in a @OneToMany relationship. or do I need to sort the collection "manually" in my program?

Regards

Re: @OneToMany - Return Order

by Guy Pelletier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Have a look at the @OrderBy annotation which can be specified with your
@OneToMany relationship.

Cheers,
Guy

----- Original Message -----
From: "RogerV" <roger.varley@...>
To: <eclipselink-users@...>
Sent: Friday, October 16, 2009 6:14 AM
Subject: [eclipselink-users] @OneToMany - Return Order


>
> Hi
>
> Is it possible to define the return order when a parent entity calls
> getChildren() in a @OneToMany relationship. or do I need to sort the
> collection "manually" in my program?
>
> Regards
> --
> View this message in context:
> http://www.nabble.com/%40OneToMany---Return-Order-tp25923022p25923022.html
> Sent from the EclipseLink - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@...
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: @OneToMany - Return Order

by RogerV :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Guy Pelletier wrote:
Have a look at the @OrderBy annotation which can be specified with your
@OneToMany relationship.
Thanks. That works a lot better after I'd changed the collection type from a Set to a List :(

Regards