Google App Engine 中的 JDO:无主一对多关系中的键顺序
我正在 Google App Engine 中使用 JDO 实现 Web 应用程序。
根据文档,在拥有的一对一中-许多关系,“所有者”对象集合中元素的顺序由自动创建的索引字段或显式排序子句中给出的信息确定。例如:
@PersistenceCapable
public class Person {
// ...
@Order(extensions = @Extension(vendorName="datanucleus", key="list-ordering", value="country asc, city asc"))
private List<ContactInfo> contacts = new List<ContactInfo>();
在无主关系中,“所有者”对象包含“嵌套”对象的键的集合,例如:
@PersistenceCapable
public class Author {
// ...
@Persistent
private List<Key> books;
如果我使用 List
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 :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,
List
的顺序会被保留,包括List
。Ordering of
List
s in general is preserved,List<Key>
included.