简体   繁体   中英

GAE: Child object that is not in the class

I am trying to duplicate the pattern described in Building Scalable, Complex Apps on App Engine . I am having trouble understanding how to tell GAE that Message index is a child of Message. From google , they say that you create a child object by including it in the parent class, but this is exactly what we are trying to prevent. So how do I store an entity as a child without including it in the parent class.

In the context of entity groups, 'child' means the MessageIndex's key is a descendant of the Message's key. It does not mean the MessageIndex list (or collection) is a property of the Message.

See the section titled "Creating Entities With Entity Groups" in documentation on transactions for an example of how to do this in Java. http://code.google.com/appengine/docs/java/datastore/transactions.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM