objectify

GeoSpatial Radius Search Using Objectify

人盡茶涼 提交于 2019-12-05 08:39:10
I am developing an application using GeoModel . I need to perform search in a particular radius based on the given latitude and longitude. I am able to generate the GeoCells in the datastore using Objectify, but not able to get back the results in a particular radius. I am sharing my code below. Entity Class @Entity public class NewsFeed implements Serializable { private static final long serialVersionUID = 1L; @Id @Index private Long feedID; @Index private String topic; @Index private String title; private String description; @Index private Date createDate; private String imageOrVideo;

Making 'OR' Queries in Google App Engine Data Model

丶灬走出姿态 提交于 2019-12-05 00:56:54
问题 I want to make a query like this "Select name from Person where Address="" OR age="" ". Is that possible in the GAE model. All things include AND closure and not OR. How can i do that with JDO/JPA, Objectify. Thanks in advance 回答1: There is no "OR" operation on the datastore. You must do two separate queries and find the intersection in your own code. http://code.google.com/appengine/docs/python/datastore/gqlreference.html 回答2: I recommend Anyone who is having difficulties with GAE datastore

inconsistency issue with Objectify query result and Datastore viewer result?

那年仲夏 提交于 2019-12-05 00:02:54
问题 I'm coding a sample project based on TodoMVC angularjs (http://todomvc.com/) and with a backend api with Google App Engine Cloud Endpoint and I'm having some consistency result when getting the todos liste from App Engine Datastore. Todo object are stored in the App Engine Datastore using objectify. A Todo entity is coded as follow: @Entity public class Todo { @Id private Long id; private String title; private boolean completed; private Date lastEdit; @Index private Long userId; public Todo()

Stripping python namespace attributes from an lxml.objectify.ObjectifiedElement [duplicate]

蓝咒 提交于 2019-12-04 22:29:37
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: When using lxml, can the XML be rendered without namespace attributes? How can I strip the python attributes from an lxml.objectify.ObjectifiedElement ? Example: In [1]: from lxml import etree, objectify In [2]: foo = objectify.Element("foo") In [3]: foo.bar = "hi" In [4]: foo.baz = 1 In [5]: foo.fritz = None In [6]: print etree.tostring(foo, pretty_print=True) <foo xmlns:py="http://codespeak.net/lxml/objectify

GAE w/ Objectify - Can you query a HashMap?

拥有回忆 提交于 2019-12-04 14:04:15
In GAE, when using Objectify, can you query a HashMap? If so how would would you write it? ofy().load().type(MyClass.class).filter("hashMapfieldName", "keyQueryinggFor").list(); Does not seem to work where the hashMapfieldName is a HashMap<String, String> . I am looking to find entities where hashMapfieldName contains a certain key. Just like embedded classes, Objectify converts Map<String, String> to the low-level EmbeddedEntity object, which is not indexible. However, if you @Index your Map field (or embedded class field), Objectify will create a synthetic index that lets you query anyways.

Service error in memcache with Java Google App Engine Standard at random time periods

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 13:54:33
In the past month, our Java Google App Engine Standard Web App started getting strange errors at seemingly random times (see stack trace below). Around this time we made the following changes: Switch from Java7 runtime to Java8/Jetty9 runtime (which allowed us more flexibility in linking to a 3rd party payments library). Switch to deploying with the Google Cloud SDK, instead of the separate Google App Engine SDK. Yesterday we experienced 3 periods with errors. One of these occurred from 0530PST to about 0600PST on Feb 28. Suddenly all attempts to load from the database started failing: com

Objectify NoClassDefFoundError

强颜欢笑 提交于 2019-12-04 10:47:53
So I just created a new GAE project in Eclipse Indigo using the Google Eclipse Plugin, and I only have the following servlet: public class TestServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.getWriter().println("Hello, world"); Objectify obj = ObjectifyService.begin(); System.out.println(obj); } } But when I run the servlet on my browser I get: java.lang.NoClassDefFoundError: com/googlecode/objectify/ObjectifyService at com.fer.TestServlet.doGet(TestServlet.java:17) at javax.servlet

When do you register classes in Objectify for GAE?

戏子无情 提交于 2019-12-04 09:04:08
问题 So this might be kind of a dumb question but when do you register classes with: ObjectifyService.register( User.class ); Currently, I'm doing this in the constructor of an interface-like class that I use in my other classes to simplify usage of the Data store specifically to my application. However, I'm getting this error: Attempted to register kind 'User' twice So, I guess my question is how often and specifically when do you register classes in Objectify? Thanks! P.S. Here's my entire class

Storing large blob with Objectify Appengine

人走茶凉 提交于 2019-12-04 08:34:54
I have this class which I want to persist using Objectify, this class will represent a data larger than 1MB so there's a List of Blob objects which represents a fragment of the byte array stored that is less than 1MB in size: @Entity public class BigBlob { @Id private Long id; public static final int FRAGMENT_LIMIT = 777 * 1024; @Serialized private List<Blob> fragments = new ArrayList<Blob>(); ... } Yet, the the "fragments" is @Serialized, which will render the size of this BigBlob class/object larger than 1MB. Causing this error: com.google.apphosting.api.ApiProxy$RequestTooLargeException:

how to apply date filter on ancestor query

橙三吉。 提交于 2019-12-04 05:49:16
问题 I have two entity model Student and attendance such that each attendance entity has associated student parent. Attendance model: @Entity public class Attendance { @Id Long id; @Index Date date; @Parent @Index @ApiResourceProperty(ignored = AnnotationBoolean.TRUE) Ref<Student> studentRef; public Long getId() { return id; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public String getWebsafeKey() { return Key.create(studentRef.getKey(), Attendance