JDO in Google App Engine: order of keys in unowned one-to-many relationship

Posted by Kel on Stack Overflow See other posts from Stack Overflow or by Kel
Published on 2011-01-08T17:48:45Z Indexed on 2011/01/08 17:54 UTC
Read the original article Hit count: 226

Filed under:
|
|

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 :(

© Stack Overflow or respective owner

Related posts about java

Related posts about google-app-engine