Hi Aleksei,
The List in the JPA1.0 spec, even if annotated with @OrderBy, is not guaranteed
to be ordered at all times if the users in their code don't maintain the order
themselves:
> 9.1.28 OrderBy Annotation
>
> The OrderBy annotation specifies the ordering of the elements of a collection
> valued association at the point when the association is *retrieved*.
I'm not sure if a Map can guarantee the order either :(.
Regards,
-marina
Aleksei Valikov wrote:
> Hi,
>
> Imagine we've a list property
>
> public List<Item> getItems();
>
> Where Item is an entity.
>
> I'd like to make the items property persistent. How could I maintain the
> order of the items in the list?
>
> The only possibility I see right now is to wrap this list as a map where keys
> are indexes. However this is very weird if you ask me.
>
> Bye. /lexi