祖先在谷歌应用引擎数据存储中意味着什么 [英] What does ancestor mean in the google app engine datastore

查看:99
本文介绍了祖先在谷歌应用引擎数据存储中意味着什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉或定义更多什么是祖先,并举例说明它的用途?我无法理解它的真实含义。



参考: http://code.google.com/appengine/docs/python/datastore/queryclass.html#Query_ancestor



感谢。

解决方案

GAE中的事务只存在于祖先后裔群组中。等同地,在我刚刚提供的URL处引用文档,



事务中的所有数据存储操作必须对实体
在同一个实体组中

和一个实体组,根据此页面在文档中定义:


当应用程序创建一个
实体时,它可以使用
来指定另一个实体
作为新实体的父项,使用
中的父参数构造函数。将父项分配给
新实体,将新实体放入与
实体相同的
实体组中。




<祖先>仅仅是父母的传递闭包 - 即给定一个实体,它的祖先是,它的父母,父母的父母等等。


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.google.com/appengine/docs/python/datastore/queryclass.html#Query_ancestor

Thanks.

解决方案

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.

这篇关于祖先在谷歌应用引擎数据存储中意味着什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆