What does ancestor mean in the google app engine datastore

前端 未结 1 999
野性不改
野性不改 2021-01-11 11:04

Can anyone tell or define more what is \"ancestor\" and give an example on it and also what it is for? I just can\'t grasp what it really is.

Reference: http://code.

相关标签:
1条回答
  • 2021-01-11 11:30

    Transactions in GAE only exist within ancestor-descendant groups. Equivalently, quoting the docs at the URL I just gave,

    All datastore operations in a transaction must operate on entities in the same entity group

    and an "entity group", per this page in the docs, are defined by:

    When the application creates an entity, it can assign another entity as the parent of the new entity, using the parent argument in the Model constructor. Assigning a parent to a new entity puts the new entity in the same entity group as the parent entity.

    "Ancestor" is just the transitive closure of "parent" -- i.e., given an entity, its ancestors are, its parent, its parent's parent, and so forth.

    0 讨论(0)
提交回复
热议问题