google-cloud-datastore

Read and Write Operations involved with ComputedProperty in GAE NDB

早过忘川 提交于 2019-12-23 00:51:06
问题 I use GAE NDB Python 2.7 My two Models code: class A(ndb.Model): def X(self, value): :: # some statements to return a value return range def Y(self, value): :: # some statements to return a value return range def Z(self, value): :: # some statements to return a value return range property_1 = ndb.IntegerProperty(default=0, indexed=False) property_2 = ndb.IntegerProperty(default=0, indexed=False) property_3 = ndb.IntegerProperty(default=0, indexed=False) property_4 = ndb.IntegerProperty

Read and Write Operations involved with ComputedProperty in GAE NDB

╄→尐↘猪︶ㄣ 提交于 2019-12-23 00:50:09
问题 I use GAE NDB Python 2.7 My two Models code: class A(ndb.Model): def X(self, value): :: # some statements to return a value return range def Y(self, value): :: # some statements to return a value return range def Z(self, value): :: # some statements to return a value return range property_1 = ndb.IntegerProperty(default=0, indexed=False) property_2 = ndb.IntegerProperty(default=0, indexed=False) property_3 = ndb.IntegerProperty(default=0, indexed=False) property_4 = ndb.IntegerProperty

Bi-directional one-to-many relationship in google app engine using JPA

橙三吉。 提交于 2019-12-22 20:42:58
问题 I want to create entity group in GAE Datastore such that one city have contain multiple suburbans. Following is my code :- //city.java @JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id") @Entity public class City { @Id private String name; @OneToMany(mappedBy="city", cascade=CascadeType.ALL) private Suburban[] suburbans; public String getName() { return name; } public void setName(String name) { this.name = name; } public Suburban[] getSuburbans() {

Bi-directional one-to-many relationship in google app engine using JPA

為{幸葍}努か 提交于 2019-12-22 20:42:11
问题 I want to create entity group in GAE Datastore such that one city have contain multiple suburbans. Following is my code :- //city.java @JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id") @Entity public class City { @Id private String name; @OneToMany(mappedBy="city", cascade=CascadeType.ALL) private Suburban[] suburbans; public String getName() { return name; } public void setName(String name) { this.name = name; } public Suburban[] getSuburbans() {

Use a db.StringProperty() as unique identifier in Google App Engine

ε祈祈猫儿з 提交于 2019-12-22 18:32:23
问题 I just have a hunch about this. But if feels like I'm doing it the wrong way. What I want to do is to have a db.StringProperty() as a unique identifier. I have a simple db.Model, with property name and file. If I add another entry with the same "name" as one already in the db.Model I want to update this. As of know I look it up with: template = Templates.all().filter('name = ', name) Check if it's one entry already: if template.count() > 0: Then add it or update it. But from what I've read

Which DB Does Google AppEngine Eclipse Plugin Uses

ぐ巨炮叔叔 提交于 2019-12-22 18:19:53
问题 Which database does the Google AppEngine Eclipse plugin use? How do I view local_db.bin file which is in war/WEB-INF/appengine-generated. Is it SQLLite ? 回答1: give gae-data-viewer a shot. That should let you view all of the data. 回答2: The App Engine Java SDK uses its own in-memory representation, which it serializes to disk for persistence. An admin console data viewer/editor ought to be out in the next SDK release. 回答3: As far as I understood local_db.bin uses internal format named "protocol

How to perform bulk update on AppEngine Datastore

醉酒当歌 提交于 2019-12-22 17:55:38
问题 The following code is not working. Does anyone know how I might get it to work? Query q = new Query("Product"); Iterable<Entity> entities = datastore.prepare(q).asIterable(); for (Entity entity : datastore.prepare(q).asIterable()) { entity.setProperty(“sale”, false); } datastore.put(entities); sale is a completely new field that I am adding to the entity kind. So it does not exist yet. UPDATE I fixed it as below but the code is still not working Query q = new Query("Product"); Iterable<Entity

Creating embedded entities with the datastore command line tool

五迷三道 提交于 2019-12-22 12:52:15
问题 I'm trying to use the Google cloud datastore command line interface to create arrays of embedded entities. I've figured out how to create an embedded entity value as follows: { "properties": { "age": { "integerValue": "5" }, "height": { "integerValue": "6" } } } and how to create an array value as follows: { "values": [ { "stringValue": "one" }, { "stringValue": "two" } ] } But I haven't figured out how to add an embedded value to an array. For example: { "values": [ { "stringValue": "one" },

invalid filter: Only one property per query may have inequality filters (>=, <=, >, <)

谁说胖子不能爱 提交于 2019-12-22 12:26:26
问题 I have a number of items which are bookable in certain timeslots. Eg. a tennis court. So each item has got a number of associated availability slots each defined by begintime and endtime. Begintime and endtime are defined as datetime-objects so an availability slot from 09.00 - 11.30, is stored as eg. 2013-12-13 09.00 (begintime) to 2013-12-13 11.30 (endtime). When a booking request comes in, I need to find out whether the tennis court is available for the desired timeslot. So I am trying to

Datastore Query returns null

前提是你 提交于 2019-12-22 11:06:22
问题 I am trying to retrieve a sorted list of the players scores from a datastore Entity of type"User" After executing: List<User> entities = ofy().load().type(User.class).order("-score").list(); Knowing that I indexed the "score" attribute. Here is the "User.class" @Id String userName; String password; @Index int score; The entities seem to be null and i can't get the entities details.What am I missing??? I am still working on that I managed to modify the method to: @Override public User display(