2
votes

I'm implementing web application with JDO in Google App Engine.

According to documentation, in owned one-to-many relationships, order of elements in "owner" object collection is determined either by automatically created index field, or by information given in explicit ordering clause. For example:

@PersistenceCapable
public class Person {

    // ...

    @Order(extensions = @Extension(vendorName="datanucleus", key="list-ordering", value="country asc, city asc"))
    private List<ContactInfo> contacts = new List<ContactInfo>();

In unowned relationships, "owner" object contains collection of keys of "nested" objects, for example:

@PersistenceCapable
public class Author {

    // ...

    @Persistent
    private List<Key> books;

Is order of keys preserved, if I use List<Key> collection in "owner" object for storing keys of "nested" elements?

I could not find answer neither in JDO relationships article, nor in Data Classes article :(

1

1 Answers

2
votes

Ordering of Lists in general is preserved, List<Key> included.