objectify

Creating a Composite Index for AppEngine in Android-Studio-based project

眉间皱痕 提交于 2019-12-22 08:42:16
问题 I used Android Studio to create both an Android project, and its backend AppEngine Endpoints counterpart. I have a datastore for which I am using Objectify. The system worked great, until I added a filter to my Query (to show only specific given emails). Query<Report> query = ofy().load().type(Report.class).filter("email", user.getEmail()).order("email").order("-when").limit(limit); This is the POJO Datastore Entity: @Entity public class Report { @Id Long id; String who; @Index Date when;

Objectify - opposite of IN filter operation

大憨熊 提交于 2019-12-22 08:40:54
问题 Is there a way to exclude in the query when a list is filtered? Something like: allow to fetch when the key is not inside keys list. List<Key<User>> userKeys = getUserKeys(); ofy().load().type(User.class).filter("__key__ ?????", userKeys).list(); 回答1: This operation is not exposed by the low level api. File a feature request in the GAE issue tracker: https://code.google.com/p/googleappengine/issues/list 来源: https://stackoverflow.com/questions/31933012/objectify-opposite-of-in-filter-operation

Objectify paging [closed]

点点圈 提交于 2019-12-22 06:47:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Can you find a good tutorial or documentation about achieving a good pagination in a Google App Engine Objectify world? I found some posts: http://groups.google.com/group/objectify-appengine/browse_thread/thread/b640b5d377b620b4 But nothing seems to help me. Is there some sort of LIMIT query? 回答1: The post you

GeoSpatial Radius Search Using Objectify

谁说我不能喝 提交于 2019-12-22 05:19:26
问题 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

objectify query filter by list in entity contains search parameter

怎甘沉沦 提交于 2019-12-21 11:32:49
问题 in an app i have an entity that contains a list of other entities (let's say an event holding a list of assigned employees) using objectify - i need to find all the events a particular employee is assigned to. is there a basic way to filter a query if it contains the parameter - kind of the opposite of the query in ... quick pseudocode findAll(Employee employee) { ... return ofy.query(Event.class).filter("employees.contains", employee).list(); } any help would be greatly appreciated i tried

objectify query filter by list in entity contains search parameter

你离开我真会死。 提交于 2019-12-21 11:32:33
问题 in an app i have an entity that contains a list of other entities (let's say an event holding a list of assigned employees) using objectify - i need to find all the events a particular employee is assigned to. is there a basic way to filter a query if it contains the parameter - kind of the opposite of the query in ... quick pseudocode findAll(Employee employee) { ... return ofy.query(Event.class).filter("employees.contains", employee).list(); } any help would be greatly appreciated i tried

Objectify doesn't store synchronously, even with now

我只是一个虾纸丫 提交于 2019-12-21 02:43:17
问题 My servlet should perform the following : when a user registers at a venue, I check whether he's currently registered somewhere (even if it is the same venue) if so, unregister him and to register him once again. I have the following code, which I've simplified in order to show my problem : Date tempDate = new Date(); Visit v = ofy().load().type(Visit.class) .filter(Visit.USER_ID, 5L) .filter(Visit.EXIT_DATE, null).first().get(); if(v != null) exitVenue(5L, 7L, tempDate); Visit visit = new

Cron Job Failure on GAE using java with automatic scaling

风流意气都作罢 提交于 2019-12-20 06:09:43
问题 I am trying to use cron job for executing some work once a day. I am using automatic scaling. Using cron job i am sending emails once a day. I have 2 conditions: Whenever i set time once a day for example every day 18:00 then cron job run successfully but its only executing 3, 4 lines of CronJob implementation class. In logger I am getting only 4 lines are executing like this:- whenever i set time as every 2 minutes or every 5 minutes then cron job run successfully and cron job implementation

Objectify query filter by List of keys that have a parent

∥☆過路亽.° 提交于 2019-12-20 05:48:15
问题 I would like to create an Api method via Google App Engine (Objectify) that returns a CollectionResponse of the posts of the people that I am following, sorted by date descending. I have an Entity Post and Entity Profile both of which have Long id as their key. The Post Entity has the following property specifying it has a Parent: @Parent private Key<Profile> profileKey; The Profile Entity has the following property storing a List of id 's of the people the profile is following: // Ids of the

Create-or-Err with Objectify

假装没事ソ 提交于 2019-12-19 11:17:51
问题 I'm getting started with Google App Engine, and I'm using Objectify. How do I create a root entity in the data store, but err if it already exists? I didn't find anything built in for this (e.g. DatastoreService.put() and therefore ofy().save() will overwrite an existing entity instead of err). The simple technique I am used to is to do this in a transaction: Err if already exists Save However, that is not idempotent; it would err in step 1 if the transaction executes twice. Here is the best