Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android App Engine用于DatabaseStore的多个数据库_Android_Sql_Google App Engine - Fatal编程技术网

Android App Engine用于DatabaseStore的多个数据库

Android App Engine用于DatabaseStore的多个数据库,android,sql,google-app-engine,Android,Sql,Google App Engine,我正在考虑使用谷歌应用程序引擎 对于我的项目,我需要几个数据存储在不同的数据库。从我到目前为止阅读的内容来看,AppEngine只提供一个数据库来存储和跟踪用户 我的问题是我需要有多个数据库来存储相同的数据,但只存储与其标准相关的数据 阿彭金是这样做的吗?顺便说一句,我将使用android应用程序。 或者我应该有自己的服务器?如果是这样,我需要实现什么?您能否解释一下,为什么需要多个数据库。 您可以使用名称空间来创建多租户环境。 您能解释一下,为什么需要多个数据库吗。 您可以使用名称空间来创建多

我正在考虑使用谷歌应用程序引擎

对于我的项目,我需要几个数据存储在不同的数据库。从我到目前为止阅读的内容来看,AppEngine只提供一个数据库来存储和跟踪用户

我的问题是我需要有多个数据库来存储相同的数据,但只存储与其标准相关的数据

阿彭金是这样做的吗?顺便说一句,我将使用android应用程序。
或者我应该有自己的服务器?如果是这样,我需要实现什么?

您能否解释一下,为什么需要多个数据库。 您可以使用名称空间来创建多租户环境。

您能解释一下,为什么需要多个数据库吗。 您可以使用名称空间来创建多租户环境。

您定义(请参阅)的每个实体在概念上都像一个表--实体的字段相当于表中的列。

您定义(请参阅)的每个实体在概念上都像一个表--实体的字段相当于表中的列。

因此,在阅读了他在回答中提供的@Moishe链接中的文档之后,我找到了答案

我只是想我会在这里发布一个答案,以节省一些人在未来的时间

下面是一个名为employees的类,它接受App engines数据存储参数

//Class name Employee
class Employee(db.Model):

//Employee information we want to enter into the Employee entity.
first_name = db.StringProperty()
last_name = db.StringProperty()
hire_date = db.DateProperty()
attended_hr_training = db.BooleanProperty()

//Set employees information to the Database Model to be inserted into the Datastore.
employee = Employee(first_name='Antonio',
                last_name='Salieri')

employee.hire_date = datetime.datetime.now().date()
employee.attended_hr_training = True

//Like committ..this initiates the insertion of the information you put into the database store mode. This works sorta like androids bundle or SharedPreference you put the information into the datastore and then committ it or save it. 

employee.put()

因此,在阅读了他的答案中@Moishe链接中的文档后,我找到了答案

我只是想我会在这里发布一个答案,以节省一些人在未来的时间

下面是一个名为employees的类,它接受App engines数据存储参数

//Class name Employee
class Employee(db.Model):

//Employee information we want to enter into the Employee entity.
first_name = db.StringProperty()
last_name = db.StringProperty()
hire_date = db.DateProperty()
attended_hr_training = db.BooleanProperty()

//Set employees information to the Database Model to be inserted into the Datastore.
employee = Employee(first_name='Antonio',
                last_name='Salieri')

employee.hire_date = datetime.datetime.now().date()
employee.attended_hr_training = True

//Like committ..this initiates the insertion of the information you put into the database store mode. This works sorta like androids bundle or SharedPreference you put the information into the datastore and then committ it or save it. 

employee.put()

我猜问题是App Engine能否支持多个表来存储数据我猜问题是App Engine能否支持多个表来存储数据我猜我不需要多个数据库。我只需要单独的表来存储相同的列,但只需要将数据从其他数据库中分离出来。我想我不需要多个数据库。我只需要使用不同的表来存储相同的列,但只需要将数据从其他数据库中分离出来,谢谢你的解释。。那么,您能否解释一下它是如何向实体添加新字段的。例如,我有一个实体名为“Miami”,而“Miami”实体有两个字段location和name。如何不断向该实体添加新条目?这是我不明白的部分。不,那根本不是真的。每个实体更像一行而不是一个表。尼克是正确的。我的意思是实体定义类似于表定义。实体实例就像表中的一行。感谢您的解释。。那么,您能否解释一下它是如何向实体添加新字段的。例如,我有一个实体名为“Miami”,而“Miami”实体有两个字段location和name。如何不断向该实体添加新条目?这是我不明白的部分。不,那根本不是真的。每个实体更像一行而不是一个表。尼克是正确的。我的意思是实体定义类似于表定义。实体实例类似于表中的一行。请使用注释。在python中,它不是
/
。这段代码也不会像这样工作。注释有什么问题吗。在python中,它不是
/
。此代码也不会像这样工作。